﻿// Page4.cpp : implementation file
//

#include "stdafx.h"
#include "TOOLBOX4.h"
#include "Page4.h"
#include "WebModule.h"
#include "LogAnalyze.h"
#include "Report.h"
#include "MyYUNDUNKeyDlg.h"
#include "MD5Checksum.h"
#include "GetIP.h"
#include "CselVirusPath.h"
#include <vector>
#include "ParseWebResultFile.h"
// CPage4

IMPLEMENT_DYNAMIC(CPage4, CWnd)
CString csEventTaskId;
//CWinThread* MyThread2;
//int g_threadstate=0;
CPage4::CPage4():m_WebMod(NULL)
{
	CString modPath = GetModulePath().c_str();
	modPath += _T("\\");
	//if(!LoadImg(_T("res/page4back.png"), m_imgBack))
	//if(!LoadImg(modPath+_T("res/page4back_test.png"), m_imgBack))
	if(!LoadImg(modPath+_T("res/background-new.png"), m_imgBack))
	{
		MessageBox(_T("图片加载失败，请检查图片是否存在！"), _T("图片加载失败"), MB_ICONERROR);
		exit(1);
	}
	//LoadImg(_T("res/nettrace_finish.png"), m_imgBack);
	m_nBackWidth = 1000;//m_imgBack.GetWidth();
	m_nBackHeight = 744;//m_imgBack.GetHeight();

	if(!LoadImg(modPath+_T("res/pane.png"), m_imgPane))
	{
		MessageBox(_T("图片加载失败，请检查图片是否存在！"), _T("图片加载失败"), MB_ICONERROR);
		exit(1);
	}
	if(!LoadImg(modPath+_T("res/pane_ok.png"), m_imgPane_ok))
	{
		MessageBox(_T("图片加载失败，请检查图片是否存在！"), _T("图片加载失败"), MB_ICONERROR);
		exit(1);
	}
	m_nPaneWidth = m_imgPane.GetWidth();
	m_nPaneHeight = m_imgPane.GetHeight();

	// 盘符
	m_rtDisk1.left = 280;
	m_rtDisk1.top = 45;
	m_rtDisk1.right = m_rtDisk1.left + m_nPaneWidth;
	m_rtDisk1.bottom = m_rtDisk1.top + m_nPaneHeight;
	m_rtDisk2.left = 340;
	m_rtDisk2.top = 45;
	m_rtDisk2.right = m_rtDisk2.left + m_nPaneWidth;
	m_rtDisk2.bottom = m_rtDisk2.top + m_nPaneHeight;
	m_rtDisk3.left = 400;
	m_rtDisk3.top = 45;
	m_rtDisk3.right = m_rtDisk3.left + m_nPaneWidth;
	m_rtDisk3.bottom = m_rtDisk3.top + m_nPaneHeight;
	m_rtDisk4.left = 460;
	m_rtDisk4.top = 45;
	m_rtDisk4.right = m_rtDisk4.left + m_nPaneWidth;
	m_rtDisk4.bottom = m_rtDisk4.top + m_nPaneHeight;
	m_rtDisk5.left = 520;
	m_rtDisk5.top = 45;
	m_rtDisk5.right = m_rtDisk5.left + m_nPaneWidth;
	m_rtDisk5.bottom = m_rtDisk5.top + m_nPaneHeight;
	m_rtDisk6.left = 580;
	m_rtDisk6.top = 45;
	m_rtDisk6.right = m_rtDisk6.left + m_nPaneWidth;
	m_rtDisk6.bottom = m_rtDisk6.top + m_nPaneHeight;
	m_rtDisk7.left =640;
	m_rtDisk7.top = 45;
	m_rtDisk7.right = m_rtDisk7.left + m_nPaneWidth;
	m_rtDisk7.bottom = m_rtDisk7.top + m_nPaneHeight;
	m_rtDisk8.left = 700;
	m_rtDisk8.top = 45;
	m_rtDisk8.right = m_rtDisk8.left + m_nPaneWidth;
	m_rtDisk8.bottom = m_rtDisk8.top + m_nPaneHeight;

	//  盘符 全选
	m_rtDiskAll.left = 180;
	m_rtDiskAll.top = 45;
	m_rtDiskAll.right = m_rtDiskAll.left + m_nPaneWidth;
	m_rtDiskAll.bottom = m_rtDiskAll.top + m_nPaneHeight;

	int hDistance = 300;	// 选框之间的水平距离
	int vDistance = 40;		// 选框之间的垂直距离
	int bgX = 110;			// 初始左上角X坐标
	int bgY = 140;			// 初始左上角Y坐标


	// 操作系统
	m_rtHostBasePane.left = 100 + 20;			//6
	m_rtHostBasePane.top = bgY;
	m_rtHostBasePane.right = m_rtHostBasePane.left + m_nPaneWidth;
	m_rtHostBasePane.bottom = m_rtHostBasePane.top + m_nPaneHeight; 
	

	// 网卡 
	m_rtNetWorkCardPane.left = m_rtHostBasePane.left;			//7
	m_rtNetWorkCardPane.top = m_rtHostBasePane.top + vDistance;
	m_rtNetWorkCardPane.right = m_rtNetWorkCardPane.left + m_nPaneWidth;
	m_rtNetWorkCardPane.bottom = m_rtNetWorkCardPane.top + m_nPaneHeight;

	// 内存 
	m_rtMemoryPane.left = m_rtNetWorkCardPane.left;			//7
	m_rtMemoryPane.top = m_rtNetWorkCardPane.top + vDistance;
	m_rtMemoryPane.right = m_rtMemoryPane.left + m_nPaneWidth;
	m_rtMemoryPane.bottom = m_rtMemoryPane.top + m_nPaneHeight;

	
	// 系统补丁
	m_rtPathInfoPane.left = m_rtMemoryPane.left;			//9
	m_rtPathInfoPane.top = m_rtMemoryPane.top + vDistance;
	m_rtPathInfoPane.right = m_rtPathInfoPane.left + m_nPaneWidth;
	m_rtPathInfoPane.bottom = m_rtPathInfoPane.top + m_nPaneHeight;

	// 服务 
	m_rtServicePane.left = m_rtPathInfoPane.left;			//8
	m_rtServicePane.top = m_rtPathInfoPane.top + vDistance;
	m_rtServicePane.right = m_rtServicePane.left + m_nPaneWidth;
	m_rtServicePane.bottom = m_rtServicePane.top + m_nPaneHeight;


	// 进程  
	m_rtProcessPane.left = m_rtServicePane.left;			//7
	m_rtProcessPane.top = m_rtServicePane.top + vDistance;
	m_rtProcessPane.right = m_rtProcessPane.left + m_nPaneWidth;
	m_rtProcessPane.bottom = m_rtProcessPane.top + m_nPaneHeight;

	// 文件操作痕迹 4
	m_rtFileOperationPane.left = m_rtProcessPane.left;//4
	m_rtFileOperationPane.top = m_rtProcessPane.top + vDistance;
	m_rtFileOperationPane.right = m_rtFileOperationPane.left + m_nPaneWidth;
	m_rtFileOperationPane.bottom = m_rtFileOperationPane.top + m_nPaneHeight;


	// 网络连接 
	m_rtPortPane.left = m_rtFileOperationPane.left;			//7
	m_rtPortPane.top = m_rtFileOperationPane.top + vDistance;
	m_rtPortPane.right = m_rtPortPane.left + m_nPaneWidth;
	m_rtPortPane.bottom = m_rtPortPane.top + m_nPaneHeight;

	// 计划任务
	m_rtTaskListPane.left = m_rtPortPane.left;			//8
	m_rtTaskListPane.top = m_rtPortPane.top + vDistance;
	m_rtTaskListPane.right = m_rtTaskListPane.left + m_nPaneWidth;
	m_rtTaskListPane.bottom = m_rtTaskListPane.top + m_nPaneHeight;


	// 启动项
	m_rtStartUpPane.left = m_rtTaskListPane.left;			//8
	m_rtStartUpPane.top = m_rtTaskListPane.top + vDistance;
	m_rtStartUpPane.right = m_rtStartUpPane.left + m_nPaneWidth;
	m_rtStartUpPane.bottom = m_rtStartUpPane.top + m_nPaneHeight;

	// 硬件信息
	m_rtHardwarePane.left = m_rtStartUpPane.left;			//8
	m_rtHardwarePane.top = m_rtStartUpPane.top + vDistance;
	m_rtHardwarePane.right = m_rtHardwarePane.left + m_nPaneWidth;
	m_rtHardwarePane.bottom = m_rtHardwarePane.top + m_nPaneHeight;





	// 联网痕迹 
	m_rtInterPane.left = 420;			//5
	m_rtInterPane.top = bgY;
	m_rtInterPane.right = m_rtInterPane.left + m_nPaneWidth;
	m_rtInterPane.bottom = m_rtInterPane.top + m_nPaneHeight;


	// USB插拔记录 12
	m_rtUSBPane.left = m_rtInterPane.left;			//12
	m_rtUSBPane.top = m_rtInterPane.top + vDistance;
	m_rtUSBPane.right = m_rtUSBPane.left + m_nPaneWidth;
	m_rtUSBPane.bottom = m_rtUSBPane.top + m_nPaneHeight;


	// 安装软件 9
	m_rtSoftWarePane.left = m_rtUSBPane.left;			//9
	m_rtSoftWarePane.top = m_rtUSBPane.top + vDistance;
	m_rtSoftWarePane.right = m_rtSoftWarePane.left + m_nPaneWidth;
	m_rtSoftWarePane.bottom = m_rtSoftWarePane.top + m_nPaneHeight;

	// 无线通讯设备
	m_rtWirelessPane.left = m_rtSoftWarePane.left;			//9
	m_rtWirelessPane.top = m_rtSoftWarePane.top + vDistance;
	m_rtWirelessPane.right = m_rtWirelessPane.left + m_nPaneWidth;
	m_rtWirelessPane.bottom = m_rtWirelessPane.top + m_nPaneHeight;

	//web检测
	m_rtWEBPane.left = m_rtWirelessPane.left;
	m_rtWEBPane.top = m_rtWirelessPane.top + vDistance * 2;
	m_rtWEBPane.right = m_rtWEBPane.left + m_nPaneWidth;
	m_rtWEBPane.bottom = m_rtWEBPane.top + m_nPaneHeight;

	// 数据库 13
	m_rtDBLogPane.left = m_rtWEBPane.left;			//14
	m_rtDBLogPane.top = m_rtWEBPane.top + vDistance * 2;
	m_rtDBLogPane.right = m_rtDBLogPane.left + m_nPaneWidth;
	m_rtDBLogPane.bottom = m_rtDBLogPane.top + m_nPaneHeight;


	// 主机日志 3
	m_rtHostLogPane.left = m_rtDBLogPane.left;
	m_rtHostLogPane.top = m_rtDBLogPane.top + vDistance * 2;
	m_rtHostLogPane.right = m_rtHostLogPane.left + m_nPaneWidth;
	m_rtHostLogPane.bottom = m_rtHostLogPane.top + m_nPaneHeight;



	// USN记录 15
	//复选框
	m_rtUSNPane.left = 750;			//15
	m_rtUSNPane.top = bgY;
	m_rtUSNPane.right = m_rtUSNPane.left + m_nPaneWidth;
	m_rtUSNPane.bottom = m_rtUSNPane.top + m_nPaneHeight;


	// 磁盘文件
	//复选框
	m_rtFileInfoPane.left = m_rtUSNPane.left;			//15
	m_rtFileInfoPane.top = m_rtUSNPane.top + vDistance;
	m_rtFileInfoPane.right = m_rtFileInfoPane.left + m_nPaneWidth;
	m_rtFileInfoPane.bottom = m_rtFileInfoPane.top + m_nPaneHeight;



	// 文件共享 11
	m_rtFileSharePane.left = m_rtFileInfoPane.left;			// 11
	m_rtFileSharePane.top = m_rtFileInfoPane.top + vDistance * 2;
	m_rtFileSharePane.right = m_rtFileSharePane.left + m_nPaneWidth;
	m_rtFileSharePane.bottom = m_rtFileSharePane.top + m_nPaneHeight;

	// 剪切板
	m_rtClipboardPane.left = m_rtFileSharePane.left;			// 11
	m_rtClipboardPane.top = m_rtFileSharePane.top + vDistance;
	m_rtClipboardPane.right = m_rtClipboardPane.left + m_nPaneWidth;
	m_rtClipboardPane.bottom = m_rtClipboardPane.top + m_nPaneHeight;

	// 安全基线 10
	m_rtAccountPane.left = m_rtClipboardPane.left;			//10
	m_rtAccountPane.top = m_rtClipboardPane.top + vDistance;
	m_rtAccountPane.right = m_rtAccountPane.left + m_nPaneWidth;
	m_rtAccountPane.bottom = m_rtAccountPane.top + m_nPaneHeight;

	// arp记录 16
	//复选框
	m_rtarpPane.left = m_rtAccountPane.left;			//15
	m_rtarpPane.top = m_rtAccountPane.top + vDistance;
	m_rtarpPane.right = m_rtarpPane.left + m_nPaneWidth;
	m_rtarpPane.bottom = m_rtarpPane.top + m_nPaneHeight;

	// DNS记录 16
	//复选框
	m_rtDNSPane.left = m_rtarpPane.left;			//15
	m_rtDNSPane.top = m_rtarpPane.top + vDistance;
	m_rtDNSPane.right = m_rtDNSPane.left + m_nPaneWidth;
	m_rtDNSPane.bottom = m_rtDNSPane.top + m_nPaneHeight;
	

	

	// 日志策略
	m_rtLogPolicyPane.left = m_rtDNSPane.left;			//9
	m_rtLogPolicyPane.top = m_rtDNSPane.top + vDistance;
	m_rtLogPolicyPane.right = m_rtLogPolicyPane.left + m_nPaneWidth;
	m_rtLogPolicyPane.bottom = m_rtLogPolicyPane.top + m_nPaneHeight;


	
	//主机资产采集分析
	m_rtPaneAllSel1.left = 80;//730;
	m_rtPaneAllSel1.top = 100;//160;
	m_rtPaneAllSel1.right = m_rtPaneAllSel1.left + m_nPaneWidth;
	m_rtPaneAllSel1.bottom = m_rtPaneAllSel1.top + m_nPaneHeight;
	
	//系统信息采集分析
	m_rtPaneAllSel2.left = 400;
	m_rtPaneAllSel2.top = 100;
	m_rtPaneAllSel2.right = m_rtPaneAllSel2.left + m_nPaneWidth;
	m_rtPaneAllSel2.bottom = m_rtPaneAllSel2.top + m_nPaneHeight;

	//web信息采集分析
	m_rtPaneAllSel3.left = 400;
	m_rtPaneAllSel3.top = 100 + vDistance * 5;
	m_rtPaneAllSel3.right = m_rtPaneAllSel3.left + m_nPaneWidth;
	m_rtPaneAllSel3.bottom = m_rtPaneAllSel3.top + m_nPaneHeight;

	//数据库日志采集分析
	m_rtPaneAllSel4.left = 400;
	m_rtPaneAllSel4.top = 100 + vDistance * 7;
	m_rtPaneAllSel4.right = m_rtPaneAllSel4.left + m_nPaneWidth;
	m_rtPaneAllSel4.bottom = m_rtPaneAllSel4.top + m_nPaneHeight;

	//Windows日志采集分析
	m_rtPaneAllSel5.left = 400;
	m_rtPaneAllSel5.top = 100 + vDistance * 9;
	m_rtPaneAllSel5.right = m_rtPaneAllSel5.left + m_nPaneWidth;
	m_rtPaneAllSel5.bottom = m_rtPaneAllSel5.top + m_nPaneHeight;

	//磁盘文件信息采集分析
	m_rtPaneAllSel6.left = 730;
	m_rtPaneAllSel6.top = 100;
	m_rtPaneAllSel6.right = m_rtPaneAllSel6.left + m_nPaneWidth;
	m_rtPaneAllSel6.bottom = m_rtPaneAllSel6.top + m_nPaneHeight;

	//其他信息采集分析
	m_rtPaneAllSel7.left = 730;
	m_rtPaneAllSel7.top = 100 + vDistance *3 ;
	m_rtPaneAllSel7.right = m_rtPaneAllSel7.left + m_nPaneWidth;
	m_rtPaneAllSel7.bottom = m_rtPaneAllSel7.top + m_nPaneHeight;

	if(!LoadImg(modPath+_T("res/cancel_off.png"), m_imgCancelBtn_off))
	{
		MessageBox(_T("图片加载失败，请检查图片是否存在！"), _T("图片加载失败"), MB_ICONERROR);
		exit(1);
	}
	if(!LoadImg(modPath+_T("res/cancel_on.png"), m_imgCancelBtn_on))
	{
		MessageBox(_T("图片加载失败，请检查图片是否存在！"), _T("图片加载失败"), MB_ICONERROR);
		exit(1);
	}
	m_nCancelWidth = m_imgCancelBtn_off.GetWidth();
	m_nCancelHeight = m_imgCancelBtn_off.GetHeight();
	m_rtCancelBtn.left = 700;
	m_rtCancelBtn.top = 580;
	m_rtCancelBtn.right = m_rtCancelBtn.left + m_nCancelWidth;
	m_rtCancelBtn.bottom = m_rtCancelBtn.top + m_nCancelHeight;

	if(!LoadImg(modPath+_T("res/ok_off.png"), m_imgOKBtn_off))
	{
		MessageBox(_T("图片加载失败，请检查图片是否存在！"), _T("图片加载失败"), MB_ICONERROR);
		exit(1);
	}
	if(!LoadImg(modPath+_T("res/ok_on.png"), m_imgOKBtn_on))
	{
		MessageBox(_T("图片加载失败，请检查图片是否存在！"), _T("图片加载失败"), MB_ICONERROR);
		exit(1);
	}
	m_nOKBtnWidth = m_imgOKBtn_off.GetWidth();
	m_nOKBtnHeight = m_imgOKBtn_off.GetHeight();
	m_rtOKBtn.left = 530;
	m_rtOKBtn.top = 580;
	m_rtOKBtn.right = m_rtOKBtn.left + m_nOKBtnWidth;
	m_rtOKBtn.bottom = m_rtOKBtn.top + m_nOKBtnHeight;
}

CPage4::~CPage4()
{
	//AfxMessageBox(_T("CPage4 的析构调用"));
}

CPage5* CPage4::m_pPage5 = NULL;

CTime CPage4::m_stBegTime = NULL;
CTime CPage4::m_stEndTime = NULL;

CPoint CPage4::m_LBtnDownPos = NULL;
CPoint CPage4::m_LBtnUpPos = NULL;

BOOL CPage4::m_bIsDisk1 = FALSE;
BOOL CPage4::m_bIsDisk2 = FALSE;
BOOL CPage4::m_bIsDisk3 = FALSE;
BOOL CPage4::m_bIsDisk4 = FALSE;
BOOL CPage4::m_bIsDisk5 = FALSE;
BOOL CPage4::m_bIsDisk6 = FALSE;
BOOL CPage4::m_bIsDisk7 = FALSE;
BOOL CPage4::m_bIsDisk8 = FALSE;

BOOL CPage4::m_bIsShowDisk1 = FALSE;
BOOL CPage4::m_bIsShowDisk2 = FALSE;
BOOL CPage4::m_bIsShowDisk3 = FALSE;
BOOL CPage4::m_bIsShowDisk4 = FALSE;
BOOL CPage4::m_bIsShowDisk5 = FALSE;
BOOL CPage4::m_bIsShowDisk6 = FALSE;
BOOL CPage4::m_bIsShowDisk7 = FALSE;
BOOL CPage4::m_bIsShowDisk8 = FALSE;
BOOL CPage4::m_bIsAllSel = FALSE;

CTOOLBOX4View* CPage4::m_pView = NULL;

CString CPage4::m_strDisk = NULL;

CString CPage4::m_strSelDisk = NULL;
std::vector<CString> CPage4::m_Viruspathlists;
BOOL CPage4::m_bIsWEBSel = FALSE;
BOOL CPage4::m_bIsVirusSel = FALSE;
BOOL CPage4::m_bIsHostLogSel = FALSE;
BOOL CPage4::m_bIsFileOperationSel = FALSE;
BOOL CPage4::m_bIsInterSel = FALSE;
BOOL CPage4::m_bIsPortSel = FALSE;
BOOL CPage4::m_bIsProcessSel = FALSE;
BOOL CPage4::m_bIsServiceSel = FALSE;
BOOL CPage4::m_bIsSoftWareSel = FALSE;
BOOL CPage4::m_bIsAccountSel = FALSE;
BOOL CPage4::m_bIsClipboardSel = FALSE;
BOOL CPage4::m_bIsFileShareSel = FALSE;
BOOL CPage4::m_bIsUSBSel = FALSE;
BOOL CPage4::m_bIsAnalyzeSel = TRUE;	// 综合分析, 一直为TRUE
BOOL CPage4::m_bIsUSNSel = FALSE;//usn记录
BOOL CPage4::m_bIsARPSel = FALSE;//arp
BOOL CPage4::m_bIsDNSSel = FALSE;//dns记录
BOOL CPage4::m_bIsLogPolicySel=FALSE;
BOOL CPage4::m_bIsPathInfoSel=FALSE;
BOOL CPage4::m_bIsFileInfoSel=FALSE;
BOOL CPage4::m_bIsMemorySel=FALSE;
BOOL CPage4::m_bIsStartUpSel=FALSE;
BOOL CPage4::m_bIsHardwareSel = FALSE;
BOOL CPage4::m_bIsWirelessSel = FALSE;
BOOL CPage4::m_bIsTaskListSel=FALSE;
BOOL CPage4::m_bIsHostBaseSel=TRUE;//基础信息一直为true
BOOL CPage4::m_bIsNetWorkCardSel = FALSE;
BOOL CPage4::m_bIsDbLogSel=FALSE;
BOOL CPage4::m_bIsSelCol1 = FALSE;
BOOL CPage4::m_bIsSelCol2 = FALSE;
BOOL CPage4::m_bIsSelCol3 = FALSE;
BOOL CPage4::m_bIsSelCol4 = FALSE;
BOOL CPage4::m_bIsSelCol5 = FALSE;
BOOL CPage4::m_bIsSelCol6 = FALSE;
BOOL CPage4::m_bIsSelCol7 = FALSE;
void CPage4::ShowBack(HDC HdestDC)
{
	m_imgBack.Draw(HdestDC, 0, 0, 1000, 744, 0, 0, m_nBackWidth, m_nBackHeight);
	//m_imgBack.Draw(HdestDC, 0, 0, m_nBackWidth, m_nBackHeight, 0, 0, m_nBackWidth, m_nBackHeight);
}
BOOL page4CopyDir(CString strSrcPath, CString strDstPath)      //拷贝文件夹及其中的所有内容
{ // 创建目标文件夹
	if (strSrcPath.Right(1) == "\\")
	{
		strSrcPath = strSrcPath.Left(strSrcPath.GetLength() - 1);
	}
	if (strDstPath.Right(1) == "\\")
	{
		strDstPath = strDstPath.Left(strDstPath.GetLength() - 1);
	}
	CreateDirectory(strDstPath,NULL);
	CFileFind finder;
	// 打开指定的文件夹进行搜索
	BOOL bWorking = finder.FindFile(strSrcPath + "\\" + "*.*"); 
	while(bWorking) 
	{
		// 从当前目录搜索文件
		bWorking = finder.FindNextFile();
		CString strFileName = finder.GetFileName(); 
		CString strSrc = strSrcPath + "\\" + strFileName;
		CString strDst = strDstPath + "\\" + strFileName;
		// 判断搜索到的是不是"."和".."目录

		if(!finder.IsDots())

		{

			// 判断搜索到的目录是否是文件夹

			if(finder.IsDirectory())

			{

				// 如果是文件夹的话，进行递归

				if(!page4CopyDir(strSrc, strDst)) 
				{
					return FALSE;
				}
			}
			else
			{
				// 如果是文件，进行复制
				if(!CopyFile(strSrc, strDst, FALSE))
				{
					if (!PathFileExists(strDst))
					{
						return FALSE;
					}
				}
			} 
		}
	}       
	return TRUE;
}

// 显示选择框， flag = true 为已选择， flag = false 为未选择
void CPage4::ShowPane(BOOL flag, HDC hDC, CRect rt)
{
	if(flag)
	{
		m_imgPane_ok.Draw(hDC, rt);
	}
	else
	{
		m_imgPane.Draw(hDC, rt);
	}
}

// 取消按钮
void CPage4::ShowCancelBtn(BOOL flag, HDC hDC)
{
	if(flag)
	{
		m_imgCancelBtn_on.Draw(hDC, m_rtCancelBtn);
	}
	else
	{
		m_imgCancelBtn_off.Draw(hDC, m_rtCancelBtn);
	}
}

// 确定按钮
void CPage4::ShowOKBtn(BOOL flag, HDC hDC)
{
	if(flag)
	{
		m_imgOKBtn_on.Draw(hDC, m_rtOKBtn);
	}
	else
	{
		m_imgOKBtn_off.Draw(hDC, m_rtOKBtn);
	}
}

// 定时器 线程 <开始采集...>  
unsigned myTimer7Thread(LPVOID lpvParam)
{
	CPage4 * page4 = (CPage4 *)lpvParam;
	page4->m_TimerID = SetTimer(page4->m_hWnd, TIMER71ID, 1000, NULL);

	return 0;
}
unsigned myTimersenThread(LPVOID lpvParam)
{
	CPage4 * page4 = (CPage4 *)lpvParam;
	page4->m_TimerID = SetTimer(page4->m_hWnd, TIMER71ID, 1000, NULL);

	return 0;
}


//线程函数 自定义采集
UINT MyThreadFunc_Custom(LPVOID pParam)
{
	CPage4 *pPage4 = (CPage4*)pParam;
	CString dPath;
	CFileFind m_FileFind;
	CPage4::m_pPage5->m_pShare->m_stcContent->SetWindowText(_T("开始采集"));
	CPage4::m_pPage5->m_pShare->m_stcContent->ShowWindow(SW_SHOW);

	CString IniFile = CTOOLBOX4App::ms_strFullResultPath;
	IniFile += _T("OriginalCfg.ydini");

	pPage4->m_TimerThread = (HANDLE)_beginthreadex(nullptr, 0, (unsigned (__stdcall*)(void*))&myTimer7Thread, pPage4, 0, nullptr);
	BOOL bIsExit = FALSE;
	CTOOLBOX4App::CopyDbFile();

	// 删除xml文件
/*	CString str;
	if(CTOOLBOX4App::m_bisUDisk)
	{
		str = CTOOLBOX4App::m_strSavePathKey;
	}
	else 
	{
		str = CTOOLBOX4App::m_strSavePath;
		str += _T("\\采集工具");
	}
	str += _T("\\采集结果\\");
	str += CTOOLBOX4App::ms_strMacAddr;
	CModule::MyDeleteFile(str);*/

	// 删除所有采集结果,并拷贝空数据库
	CTOOLBOX4App::DelResultFile();

	CDisposeResult::MyClearVector();
	//// 清空 联网痕迹-深度 采集结果
	//CLogAnalyze::ClearNetDeepRst();
	//// 清空 介质痕迹-深度 采集结果
	//CLogAnalyze::ClearUsbDeepRst();

	CModule module;

	/////////调用内核工具需要的变量/////////////////
	int nParam = 6;
	CString strSysPathAll;
	CString strSysPath = CTOOLBOX4App::ms_ModPath;
	CString sIsCloudEnv = _T(""); 
	CString strtemp = _T("");
	CString strutemp = _T("");
	//CString strtemp,strutemp;
	TCHAR szSpeclPath[MAX_PATH] = {0};
	SHGetSpecialFolderPath(NULL,szSpeclPath,CSIDL_PROGRAM_FILES,false);
	CString strFilePath(szSpeclPath);
	BOOL bFree = TRUE;
	////////////////////////

	if(pPage4->m_TimerID != 0)
		KillTimer(pPage4->m_hWnd, pPage4->m_TimerID);
	TerminateThread(pPage4->m_TimerThread, 0);
	
	sqlite3*db;
	CString dbName = CTOOLBOX4App::ms_strFullResultPath;
	dbName += _T("主机层\\hongtan004.db");
	char * pDbName = UnicodeToUtf8(dbName);
	int ret = sqlite3_open(pDbName, &db);
	if(ret != SQLITE_OK)
	{
		AfxMessageBox(_T("打开数据库失败-hostlog!"));
		OutputDebugString(_T("打开数据库失败!"));
		exit(-1);
	}

	CLogAnalyze LogAnal;
	if(CPage4::m_bIsHostBaseSel)	// 操作系统
	{
		//module.NetTrace(CPage4::m_pPage5->m_hWnd, CUSTOMGATHER);
		module.HostBaseInfo(CPage4::m_pPage5->m_hWnd, db);
	}
	if(CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsNetWorkCardSel)	// 网卡
	{
		module.NetWorkCard(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsMemorySel)	// 内存镜像
	{
		module.Memory(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if(CPage4::m_bIsPathInfoSel)	// 系统补丁
	{
		
		module.PathInfoTrace(CPage4::m_pPage5->m_hWnd, db);
		
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsServiceSel)	// 服务
	{
		//module.Process(CPage4::m_pPage5->m_hWnd);
		module.Service(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsProcessSel)	// 进程
	{
		//module.Port(CPage4::m_pPage5->m_hWnd);
		OutputDebugString(_T("开始进程"));
		module.Process(CPage4::m_pPage5->m_hWnd, db);
		OutputDebugString(_T("退出进程"));
	}
	if (CModule::m_bStop)
		goto STOP;
	if(CPage4::m_bIsFileOperationSel)	// 文件操作痕迹
	{
		//module.DbLog(CPage4::m_pPage5->m_hWnd);
		module.FileTrace(CPage4::m_pPage5->m_hWnd, db);
	}
	if(CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsPortSel)	// 网络连接
	{
		//module.NetTrace(CPage4::m_pPage5->m_hWnd, CUSTOMGATHER);
		module.Port(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsTaskListSel)	// 计划任务
	{
		//module.Process(CPage4::m_pPage5->m_hWnd);
		OutputDebugString(_T("计划任务"));
		module.TaskListsInfo(CPage4::m_pPage5->m_hWnd, db);
		OutputDebugString(_T("计划任务"));
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsStartUpSel)	// 启动项
	{
		//module.Process(CPage4::m_pPage5->m_hWnd);
		OutputDebugString(_T("开始启动项"));
		module.StartUpInfo(CPage4::m_pPage5->m_hWnd, db);
		OutputDebugString(_T("开始启动项"));
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsHardwareSel)	// 硬件信息
	{

		module.Hardware(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if(CPage4::m_bIsInterSel)	// 联网痕迹
	{
		//module.FileTrace(CPage4::m_pPage5->m_hWnd);
		module.NetTrace(CPage4::m_pPage5->m_hWnd, CUSTOMGATHER, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsUSBSel)	// USB插拔记录
	{
		//module.FileShare(CPage4::m_pPage5->m_hWnd);
		module.USBTrace(CPage4::m_pPage5->m_hWnd, CUSTOMGATHER, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsSoftWareSel)	// 安装软件
	{
		//module.Service(CPage4::m_pPage5->m_hWnd);
		CDisposeResult::MyClearSoftWare();
		module.SoftWare(CPage4::m_pPage5->m_hWnd, db);
		//CDisposeResult::WriteXml();
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsWirelessSel)	// 硬件信息
	{

		module.Wireless(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsWEBSel)	// Web检测
	{
		//pPage4->m_WebMod = new CWebModule;
		//pPage4->m_WebMod->WebFile(3);
		CWebModule Web;
		Web.m_bIsWebFile = TRUE;
		Web.m_bIsWebLog = TRUE;
		Web.WebFile(3);
		WaitForSingleObject(CWebModule::m_shThread, INFINITE); // 永久等待
		CloseHandle(CWebModule::m_shThread);
		CWebModule::m_shThread = NULL;
		//if(pPage4->m_WebMod != NULL)
		//	delete pPage4->m_WebMod;
		int tackID = WEBENGINE_CUSTOM;
		//// 自定义中间件
		Web.CustomWeb(pPage4->m_pPage5->m_hWnd, tackID);
		WaitForSingleObject(CWebModule::m_shThread, INFINITE); // 永久等待
		CloseHandle(CWebModule::m_shThread);
		CWebModule::m_shThread = NULL;


		TASKPROGRESS ofX;
		ofX.pszText = TEXT("Web文件采集完成");
		ofX.nProgress = 100;
		SendMessage(pPage4->m_pPage5->m_hWnd, WM_RETPROGRESS, (WPARAM)&tackID, (LPARAM)&ofX);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsDbLogSel) //数据库日志
	{
		module.m_endTime = CPage4::m_stEndTime;
		module.m_beginTime = CPage4::m_stBegTime;
		module.DataBaseLogInfo(CPage4::m_pPage5->m_hWnd, db, 3, CPage4::m_stBegTime, CPage4::m_stEndTime);
		if (CModule::m_bStop)
			goto STOP;
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsHostLogSel)	// 主机日志
	{
		//module.HostLog(CPage4::m_pPage5->m_hWnd, CUSTOMGATHER, CPage4::m_stBegTime, db);
		module.m_endTime = CPage4::m_stEndTime;
		//	module.HostLog(CPage4::m_pPage5->m_hWnd, CUSTOMGATHER, CPage4::m_stBegTime, db);
		module.HostLog(CPage4::m_pPage5->m_hWnd, CUSTOMGATHER, CPage4::m_stBegTime, db, CTOOLBOX4App::ms_strFullResultPath);

	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsUSNSel)	// usn
	{
		//module.DbLog(CPage4::m_pPage5->m_hWnd);
		CString strDisk;
		strDisk = CPage4::m_strSelDisk;
		module.USNTrace(strDisk, CPage4::m_pPage5->m_hWnd, db, 3, CPage4::m_stBegTime, CPage4::m_stEndTime,false);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsFileInfoSel)	// 磁盘文件
	{
		//module.DbLog(CPage4::m_pPage5->m_hWnd);
		CString strDisk;
		strDisk = CPage4::m_strSelDisk;
		module.FileInfoTrace(strDisk, CPage4::m_pPage5->m_hWnd, db, 3, CPage4::m_stBegTime.GetTime(), CPage4::m_stEndTime.GetTime(),false);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsFileShareSel)	// 文件共享
	{
		//module.AccountSec(CPage4::m_pPage5->m_hWnd);
		module.FileShare(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsClipboardSel)	// 剪切板
	{
		//CDisposeResult::MyClearSoftWare();
		//module.SoftWare(CPage4::m_pPage5->m_hWnd);
		//CDisposeResult::WriteXml();
		module.Clipboard(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsAccountSel)	// 安全基线
	{
		//CDisposeResult::MyClearSoftWare();
		//module.SoftWare(CPage4::m_pPage5->m_hWnd);
		//CDisposeResult::WriteXml();
		module.AccountSec(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsARPSel)	//ARP
	{
		//module.FileTrace(CPage4::m_pPage5->m_hWnd);
		module.ARPTrace(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsDNSSel)	//DNS
	{
		//module.FileTrace(CPage4::m_pPage5->m_hWnd);
		module.DNSTrace(CPage4::m_pPage5->m_hWnd, db);
	}
	if (CModule::m_bStop)
		goto STOP;
	if (CPage4::m_bIsLogPolicySel)	// 日志策略
	{
		module.LogPolicyTrace(CPage4::m_pPage5->m_hWnd, db);

	}
	if (CModule::m_bStop)
		goto STOP;
	sqlite3_close(db);
	ret = sqlite3_open(pDbName, &db);
	if(ret != SQLITE_OK)
	{
		AfxMessageBox(_T("打开数据库失败-hostlog!"));
		OutputDebugString(_T("打开数据库失败!"));
		exit(-1);
	}
	SetIniFileKeyValue(IniFile.GetBuffer(), TEXT("IsStop"), TEXT("isStop"), _T("C_1"));
 	if(CPage4::m_bIsAnalyzeSel)	// 综合分析
	{
		int tackID3 = CHECK_ANALYZE;
		TASKPROGRESS ofX3;
		ofX3.pszText = TEXT("正在进行结果分析,请稍候...");
		ofX3.nProgress = 1;
		SendMessage(pPage4->m_pPage5->m_hWnd, WM_RETPROGRESS, (WPARAM)&tackID3, (LPARAM)&ofX3);

		OutputDebugString(_T("WriteSqlite3 u"));
		module.WriteSqlite3(pPage4->m_pPage5->m_hWnd, tackID3,3,CPage4::m_stBegTime.GetTime(),CPage4::m_stEndTime.GetTime());
		if(CModule::m_bStop)
			goto STOP;

		LogAnal.SynthesisAnalyze(pPage4->m_pPage5->m_hWnd, tackID3, CUSTOMGATHER, db);
		if(CModule::m_bStop)
			goto STOP;

	}
 	sqlite3_close(db);
	SetIniFileKeyValue(IniFile.GetBuffer(), TEXT("IsStop"), TEXT("isStop"), _T("C_0"));
	
	//////////////////////////////////////////////////////////////////////////
	//CString del = _T("G:\\采集工具\\采集结果\\18-31-BF-CA-32-6D\\WebAttackAction\\Result1\\WebScanner\\watchertrack_attack_AWVSAttack.ydtxt");

	// 在此处生成HTML文件
/*	AFX_THREADPROC MyFunc1 = MyThreadFunc_BuildHtml;
	CWinThread* MyThread1 = AfxBeginThread(MyFunc1, pPage4 , THREAD_PRIORITY_NORMAL , 0 , 0 , NULL);
	WaitForSingleObject(MyThread1->m_hThread, INFINITE);
	*/
	// 报告
/*	AFX_THREADPROC MyFunc2 = MyThreadFunc_BuildReport;
	CWinThread* MyThread2 = AfxBeginThread(MyFunc2, pPage4 , THREAD_PRIORITY_NORMAL , 0 , 0 , NULL);
	WaitForSingleObject(MyThread2->m_hThread, INFINITE);
	*/

	
	if(CTOOLBOX4App::m_bNetWork)
	{
		//弹框，提问是否压缩结果包
		if(AfxMessageBox(TEXT("是否授权压缩结果包?压缩完成后将自动关闭程序!"),MB_YESNO) == IDYES)
		{
			// 给数据库添加一个标识, 避免重复导入
			CDisposeResult::ImportFlag();

			bIsExit = TRUE;
			if(CTOOLBOX4App::m_strUSavePathKey.GetLength()==0)
			{
				CDisposeResult::ImportFlag();

				bIsExit = TRUE;
				//将结果路径的采集工具压缩
				CString str_zipPath = Str_SavePath;
				str_zipPath=str_zipPath+ + TEXT(".zip");
				DeleteFile(str_zipPath);
				if(ZipFile_7Z(Str_SavePath,str_zipPath))
				{
					char check[8] = "toolbox";
					if(!addcheckfor7Z(str_zipPath, check, sizeof(char)*8))
						OutputDebugString(_T("快速采集结果压缩包添加校验失败!"));
				}
				if(Str_SavePath.GetLength()!=0)
				{
					myDeleteDirectory(Str_SavePath, TRUE);
				}
				
			}
			else
			{

				if(CTOOLBOX4App::m_strUSavePathKey.GetLength()!=0)
				{
				//将结果路径的采集工具压缩
					strtemp=CTOOLBOX4App::m_strSavePathKey;
					CString str_zipPath = strtemp + TEXT(".zip");
					DeleteFile(str_zipPath);
					if(ZipFile_7Z(strtemp,str_zipPath))
					{
						char check[8] = "toolbox";
						if(!addcheckfor7Z(str_zipPath, check, sizeof(char)*8))
							OutputDebugString(_T("自定义采集结果压缩包添加校验失败!"));
					}
					CreateDirectory(CTOOLBOX4App::m_strUSavePathKey,NULL);

					strtemp=CTOOLBOX4App::m_strSavePathKey;
					strutemp=CTOOLBOX4App::m_strUSavePathKey;
					CString strNewFile;
					strNewFile=strutemp+_T(".zip");
					DeleteFile(strNewFile);
					//	CPage4::page4CopyDir()
					CopyFile(str_zipPath,strNewFile,TRUE);
					//page4CopyDir(str_zipPath, CTOOLBOX4App::m_strUSavePathKey);
					if(strtemp.GetLength()!=0)
					{
						myDeleteDirectory(strtemp,TRUE);
					}
					
					DeleteFile(str_zipPath);
				}
			}
		}
	}
	else
	{
		OutputDebugString(CTOOLBOX4App::m_strUSavePathKey);
		if(CTOOLBOX4App::m_strUSavePathKey.GetLength()!=0)
		{

		
			CreateDirectory(CTOOLBOX4App::m_strUSavePathKey,NULL);
			OutputDebugString(CTOOLBOX4App::m_strUSavePathKey);
			strtemp=CTOOLBOX4App::m_strSavePathKey;
			strutemp=CTOOLBOX4App::m_strUSavePathKey;
			//	CPage4::page4CopyDir()

			page4CopyDir(strtemp, strutemp);
			OutputDebugString(strtemp);
			//删除硬盘里的存储结果
			if(strtemp.GetLength()!=0||CTOOLBOX4App::m_strSavePathKey.GetLength()>1)
			{
				myDeleteDirectory(strtemp,TRUE);
			}
			
			dPath= CTOOLBOX4App::ms_strResultPath + _T("\\WebEngine");
			myDeleteDirectory(dPath,TRUE);
			/*if(m_FileFind.FindFile(dPath))
			{
				myDeleteDirectory(dPath,TRUE);

			}*/
		}
	}

STOP:
	if(CPage4::m_bIsAnalyzeSel)
	{
		int tackID3 = CHECK_ANALYZE;
		TASKPROGRESS ofX4;
		ofX4.pszText = TEXT("完成");
		ofX4.nProgress = 100;
		SendMessage(pPage4->m_pPage5->m_hWnd, WM_RETPROGRESS, (WPARAM)&tackID3, (LPARAM)&ofX4);
	}
	

	
	//if(g_threadstate==1)
	{
		CPage4::m_pPage5->m_pShare->m_stcContent->SetWindowText(_T("采集完成"));
		CPage4::m_pPage5->m_pShare->m_stcContent->ShowWindow(SW_SHOW);
		CPage5::m_bIsRet = TRUE;  // 采集完成,显示返回按钮
		CPage4::m_pPage5->Invalidate();
	}
// 	else
// 	{
// 		while(1)
// 		{
// 			
// 			if(g_threadstate==1)
// 			{
// 				CPage4::m_pPage5->m_pShare->m_stcContent->SetWindowText(_T("采集完成"));
// 				CPage4::m_pPage5->m_pShare->m_stcContent->ShowWindow(SW_SHOW);
// 				CPage5::m_bIsRet = TRUE;  // 采集完成,显示返回按钮
// 				CPage4::m_pPage5->Invalidate();
// 				break;
// 			}
// 			Sleep(1000);
// 		}
// 	}

	if(bIsExit)
		exit(0);

	return 0;
}

BEGIN_MESSAGE_MAP(CPage4, CWnd)
	ON_WM_PAINT()
	ON_WM_CREATE()
	ON_WM_CTLCOLOR()
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	ON_WM_MOUSEMOVE()
	ON_WM_TIMER()
END_MESSAGE_MAP()



// CPage4 message handlers


void CPage4::OnPaint()
{
	CPaintDC dc(this); // device context for painting
	// TODO: Add your message handler code here
	// Do not call CWnd::OnPaint() for painting messages
	HDC hdc = dc.GetSafeHdc();
	ShowBack(hdc);  // 背景
	//ShowCancelBtn(FALSE, hdc); // 取消按钮
	//ShowOKBtn(FALSE, hdc);     // 确定按钮

	m_pBeginTime->ShowWindow(SW_SHOW);
	m_pEndTime->ShowWindow(SW_SHOW);

	ShowPane(m_bIsWEBSel, hdc, m_rtWEBPane);
	ShowPane(m_bIsHostLogSel, hdc, m_rtHostLogPane);
	ShowPane(m_bIsFileOperationSel, hdc, m_rtFileOperationPane);
	ShowPane(m_bIsInterSel, hdc, m_rtInterPane);
	ShowPane(m_bIsPortSel, hdc, m_rtPortPane);
	ShowPane(m_bIsProcessSel, hdc, m_rtProcessPane);
	ShowPane(m_bIsServiceSel, hdc, m_rtServicePane);
	ShowPane(m_bIsSoftWareSel, hdc, m_rtSoftWarePane);
	ShowPane(m_bIsAccountSel, hdc, m_rtAccountPane);
	ShowPane(m_bIsFileShareSel, hdc, m_rtFileSharePane);
	ShowPane(m_bIsUSBSel, hdc, m_rtUSBPane);
	ShowPane(m_bIsUSNSel, hdc, m_rtUSNPane);
	ShowPane(m_bIsARPSel, hdc, m_rtarpPane);
	ShowPane(m_bIsAllSel, hdc, m_rtDiskAll);;
	ShowPane(m_bIsSelCol1, hdc, m_rtPaneAllSel1);
	ShowPane(m_bIsSelCol2, hdc, m_rtPaneAllSel2);
	ShowPane(m_bIsSelCol3, hdc, m_rtPaneAllSel3);
	ShowPane(m_bIsSelCol4, hdc, m_rtPaneAllSel4);
	ShowPane(m_bIsSelCol5, hdc, m_rtPaneAllSel5);
	ShowPane(m_bIsSelCol6, hdc, m_rtPaneAllSel6);
	ShowPane(m_bIsSelCol7, hdc, m_rtPaneAllSel7);
	ShowPane(m_bIsDNSSel, hdc, m_rtDNSPane);
	ShowPane(m_bIsLogPolicySel, hdc, m_rtLogPolicyPane);
	ShowPane(m_bIsPathInfoSel, hdc, m_rtPathInfoPane);
	ShowPane(m_bIsFileInfoSel, hdc, m_rtFileInfoPane);
	ShowPane(m_bIsTaskListSel, hdc, m_rtTaskListPane);
	ShowPane(m_bIsStartUpSel, hdc, m_rtStartUpPane);
	ShowPane(m_bIsHardwareSel, hdc, m_rtHardwarePane);
	ShowPane(m_bIsTaskListSel, hdc, m_rtTaskListPane);
	ShowPane(m_bIsHostBaseSel, hdc, m_rtHostBasePane);
	ShowPane(m_bIsNetWorkCardSel, hdc, m_rtNetWorkCardPane);
	ShowPane(m_bIsMemorySel, hdc, m_rtMemoryPane);
	ShowPane(m_bIsClipboardSel, hdc, m_rtClipboardPane);
	ShowPane(m_bIsDbLogSel, hdc, m_rtDBLogPane);//复选框
	ShowPane(m_bIsWirelessSel, hdc, m_rtWirelessPane);//复选框
//	ShowPane(m_bIsMemorySel, hdc, m_rtMemoryPane);
	CString str;
	if(1 <= m_strDisk.GetLength()/3)
	{
		m_bIsShowDisk1 = TRUE;
		ShowPane(m_bIsDisk1, hdc, m_rtDisk1);
		str.Format(_T("%s 盘"), m_strDisk.Mid(0,1));
		m_stcDisk1->SetWindowText(str);
		m_stcDisk1->ShowWindow(SW_SHOW);
	}
	if(2 <= m_strDisk.GetLength()/3)
	{
		m_bIsShowDisk2 = TRUE;
		ShowPane(m_bIsDisk2, hdc, m_rtDisk2);
		str.Format(_T("%s 盘"), m_strDisk.Mid(3,1));
		m_stcDisk2->SetWindowText(str);
		m_stcDisk2->ShowWindow(SW_SHOW);
	}else
	{
		m_stcDisk2->ShowWindow(SW_HIDE);
		m_bIsShowDisk2 = FALSE;
	}
	if(3 <= m_strDisk.GetLength()/3)
	{
		m_bIsShowDisk3 = TRUE;
		ShowPane(m_bIsDisk3, hdc, m_rtDisk3);
		str.Format(_T("%s 盘"), m_strDisk.Mid(6,1));
		m_stcDisk3->SetWindowText(str);
		m_stcDisk3->ShowWindow(SW_SHOW);
	}else
	{
		m_stcDisk3->ShowWindow(SW_HIDE);
		m_bIsShowDisk3 = FALSE;
	}
		
	if(4 <= m_strDisk.GetLength()/3)
	{
		m_bIsShowDisk4 = TRUE;
		ShowPane(m_bIsDisk4, hdc, m_rtDisk4);
		str.Format(_T("%s 盘"), m_strDisk.Mid(9,1));
		m_stcDisk4->SetWindowText(str);
		m_stcDisk4->ShowWindow(SW_SHOW);
	}else
	{
		m_stcDisk4->ShowWindow(SW_HIDE);
		m_bIsShowDisk4 = FALSE;
	}
	if(5 <= m_strDisk.GetLength()/3)
	{
		m_bIsShowDisk5 = TRUE;
		ShowPane(m_bIsDisk5, hdc, m_rtDisk5);
		str.Format(_T("%s 盘"), m_strDisk.Mid(12,1));
		m_stcDisk5->SetWindowText(str);
		m_stcDisk5->ShowWindow(SW_SHOW);
	}else
	{
		m_stcDisk5->ShowWindow(SW_HIDE);
		m_bIsShowDisk5 = FALSE;
	}
	if(6 <= m_strDisk.GetLength()/3)
	{
		m_bIsShowDisk6 = TRUE;
		ShowPane(m_bIsDisk6, hdc, m_rtDisk6);
		str.Format(_T("%s 盘"), m_strDisk.Mid(15,1));
		m_stcDisk6->SetWindowText(str);
		m_stcDisk6->ShowWindow(SW_SHOW);
	}else
	{
		m_stcDisk6->ShowWindow(SW_HIDE);
		m_bIsShowDisk6 = FALSE;
	}

	if(7 <= m_strDisk.GetLength()/3)
	{
		m_bIsShowDisk7 = TRUE;
		ShowPane(m_bIsDisk7, hdc, m_rtDisk7);
		str.Format(_T("%s 盘"), m_strDisk.Mid(18,1));
		m_stcDisk7->SetWindowText(str);
		m_stcDisk7->ShowWindow(SW_SHOW);
	}else
	{
		m_stcDisk7->ShowWindow(SW_HIDE);
		m_bIsShowDisk7 = FALSE;
	}
	if(8 <= m_strDisk.GetLength()/3)
	{
		m_bIsShowDisk8 = TRUE;
		ShowPane(m_bIsDisk8, hdc, m_rtDisk8);
		str.Format(_T("%s 盘"), m_strDisk.Mid(21,1));
		m_stcDisk8->SetWindowText(str);
		m_stcDisk8->ShowWindow(SW_SHOW);
	}else
	{
		m_stcDisk8->ShowWindow(SW_HIDE);
		m_bIsShowDisk8 = FALSE;
	}
	
	CPoint mousePos;
	CRect rt_cancel(m_rtCancelBtn);
	CRect rt_ok(m_rtOKBtn);
	GetCursorPos(&mousePos);
	ClientToScreen(rt_cancel);
	ClientToScreen(rt_ok);
	if(rt_cancel.PtInRect(mousePos))
	{
		ShowCancelBtn(TRUE, hdc);
	}
	else
	{
		ShowCancelBtn(FALSE, hdc);
	}
	if(rt_ok.PtInRect(mousePos))
	{
		ShowOKBtn(TRUE, hdc);
	}
	else
	{
		ShowOKBtn(FALSE, hdc);
	}

}


int CPage4::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	// TODO:  Add your specialized creation code here


	m_font.CreatePointFont(100, L"微软雅黑");
	//m_FontAll.CreatePointFont(150, L"微软雅黑");

	m_stcSelTime = new CStatic;
	m_stcSelTime->Create(_T("选择时间"), WS_CHILD|WS_VISIBLE, CRect(100, 24, 180, 44), this, IDSTCSELTIME);
	m_stcSelTime->SetFont(&m_font);
	m_stcSelDisk = new CStatic;
	m_stcSelDisk->Create(_T("选择盘符"), WS_CHILD|WS_VISIBLE, CRect(100,50, 180,70), this, IDSTCSELDISK);
	m_stcSelDisk->SetFont(&m_font);

	m_stcDisk1 = new CStatic;
	m_stcDisk1->Create(NULL, WS_CHILD, CRect(305, 50, 370, 70), this, IDSTCDISK1);
	m_stcDisk1->SetFont(&m_font);

	m_stcDisk2 = new CStatic;
	m_stcDisk2->Create(NULL, WS_CHILD, CRect(365, 50, 430, 70), this, IDSTCDISK2);
	m_stcDisk2->SetFont(&m_font);

	m_stcDisk3 = new CStatic;
	m_stcDisk3->Create(NULL, WS_CHILD, CRect(425, 50, 495, 70), this, IDSTCDISK3);
	m_stcDisk3->SetFont(&m_font);

	m_stcDisk4 = new CStatic;
	m_stcDisk4->Create(NULL, WS_CHILD, CRect(485, 50, 555, 70), this, IDSTCDISK4);
	m_stcDisk4->SetFont(&m_font);

	m_stcDisk5 = new CStatic;
	m_stcDisk5->Create(NULL, WS_CHILD, CRect(545, 50, 615, 70), this, IDSTCDISK5);
	m_stcDisk5->SetFont(&m_font);

	m_stcDisk6 = new CStatic;
	m_stcDisk6->Create(NULL, WS_CHILD, CRect(605, 50, 675, 70), this, IDSTCDISK6);
	m_stcDisk6->SetFont(&m_font);

	m_stcDisk7 = new CStatic;
	m_stcDisk7->Create(NULL, WS_CHILD, CRect(665, 50, 735, 70), this, IDSTCDISK7);
	m_stcDisk7->SetFont(&m_font);

	m_stcDisk8 = new CStatic;
	m_stcDisk8->Create(NULL, WS_CHILD, CRect(725, 50, 790, 70), this, IDSTCDISK8);
	m_stcDisk8->SetFont(&m_font);

	m_stcDiskAll = new CStatic;
	m_stcDiskAll->Create(_T("全选"), WS_CHILD|WS_VISIBLE, CRect(220, 50, 250, 70), this, DISKALLSEL);
	m_stcDiskAll->SetFont(&m_font);

	m_pBeginTime = new CDateTimeCtrl;
	m_pBeginTime->Create(WS_CHILD | WS_TABSTOP |DTS_SHORTDATEFORMAT, CRect(335, 20, 455, 45), this, IDBEGINTIME);

	m_pEndTime = new CDateTimeCtrl;
	m_pEndTime->Create(WS_CHILD | WS_TABSTOP |DTS_SHORTDATEFORMAT,CRect(750,20,870,45),this, IDENDTIME);

	m_stcBegTime = new CStatic;
	m_stcBegTime->Create(_T("起始时间："), WS_CHILD|WS_VISIBLE, CRect(235, 24, 315, 44), this, IDSTCBEGTIME);
	m_stcBegTime->SetFont(&m_font);

	m_stcEndTime = new CStatic;
	m_stcEndTime->Create(_T("结束时间："), WS_CHILD|WS_VISIBLE, CRect(650, 24, 730, 44), this, IDSTCENDTIME);
	m_stcEndTime->SetFont(&m_font);

	int hDistance = 30;		// 文字控件与选框的水平差距
	int vDistance = 5;		// 文字控件与选框的垂直差距
	int TextWidth = 70;		// 文字控件的宽度
	int TextHeight = 20;	// 文本控件的高度

	CRect rt_WebFile;
	rt_WebFile.left = m_rtWEBPane.left+hDistance;
	rt_WebFile.top = m_rtWEBPane.top+vDistance;
	rt_WebFile.right = rt_WebFile.left + TextWidth;
	rt_WebFile.bottom = rt_WebFile.top + TextHeight;
	m_stcWebFile = new CStatic;//CRect(150, 205, 240, 225)
	m_stcWebFile->Create(_T("Web检测"), WS_CHILD|WS_VISIBLE, rt_WebFile, this, WEBFILEID);
	m_stcWebFile->SetFont(&m_font);
	

	CRect rt_HostLog;
	rt_HostLog.left = m_rtHostLogPane.left + hDistance;
	rt_HostLog.top = m_rtHostLogPane.top + vDistance;
	rt_HostLog.right = rt_HostLog.left + TextWidth;
	rt_HostLog.bottom = rt_HostLog.top + TextHeight;
	m_stcHostLog = new CStatic;
	m_stcHostLog->Create(_T("主机日志"), WS_CHILD|WS_VISIBLE, rt_HostLog, this, HOSTLOGID);
	m_stcHostLog->SetFont(&m_font);



	CRect rt_FileTrace;
	rt_FileTrace.left = m_rtFileOperationPane.left + hDistance;
	rt_FileTrace.top = m_rtFileOperationPane.top + vDistance;
	rt_FileTrace.right = rt_FileTrace.left + TextWidth * 2;
	rt_FileTrace.bottom = rt_FileTrace.top + TextHeight;
	m_stcFileTrace = new CStatic;//CRect(150, 305, 240, 325)  //CRect(810, 205, 900, 225)
	m_stcFileTrace->Create(_T("文件操作痕迹"), WS_CHILD|WS_VISIBLE, rt_FileTrace, this, FILETRACEID);
	m_stcFileTrace->SetFont(&m_font);

	//2020.12.18
	CRect rt_USNTrace;
	rt_USNTrace.left = m_rtUSNPane.left + hDistance;
	rt_USNTrace.top = m_rtUSNPane.top + vDistance;
	rt_USNTrace.right = rt_USNTrace.left + TextWidth;
	rt_USNTrace.bottom = rt_USNTrace.top + TextHeight;
	m_stcUSNTrace = new CStatic;//CRect(830, 405, 920, 425)//CRect(660, 405, 750, 425)
	m_stcUSNTrace->Create(_T("USN记录"), WS_CHILD|WS_VISIBLE, rt_USNTrace, this, USNTRACEID);
	m_stcUSNTrace->SetFont(&m_font);
	CRect rt_NetTrace;
	rt_NetTrace.left = m_rtInterPane.left + hDistance;
	rt_NetTrace.top = m_rtInterPane.top + vDistance;
	rt_NetTrace.right = rt_NetTrace.left + TextWidth;
	rt_NetTrace.bottom = rt_NetTrace.top + TextHeight;
	m_stcNetTrace = new CStatic;//CRect(320, 305, 410, 325)
	m_stcNetTrace->Create(_T("联网痕迹"), WS_CHILD|WS_VISIBLE, rt_NetTrace, this, NETTRACEID);
	m_stcNetTrace->SetFont(&m_font);

	CRect rt_Port;
	rt_Port.left = m_rtPortPane.left + hDistance;
	rt_Port.top = m_rtPortPane.top + vDistance;
	rt_Port.right = rt_Port.left + TextWidth;
	rt_Port.bottom = rt_Port.top + TextHeight;
	m_stcPort = new CStatic;//CRect(490, 305, 580, 325)
	m_stcPort->Create(_T("网络连接"), WS_CHILD|WS_VISIBLE, rt_Port, this, PORTID);
	m_stcPort->SetFont(&m_font);
	CRect rt_HostBase;
	rt_HostBase.left = m_rtHostBasePane.left + hDistance;
	rt_HostBase.top = m_rtHostBasePane.top + vDistance;
	rt_HostBase.right = rt_HostBase.left + TextWidth;
	rt_HostBase.bottom = rt_HostBase.top + TextHeight;
	m_stcHostBaseTrace = new CStatic;//CRect(490, 305, 580, 325)
	m_stcHostBaseTrace->Create(_T("操作系统"), WS_CHILD|WS_VISIBLE, rt_HostBase,this, HOSTBASETRACEID);
	m_stcHostBaseTrace->SetFont(&m_font);


	CRect rt_NetWorkCard;
	rt_NetWorkCard.left = m_rtNetWorkCardPane.left + hDistance;
	rt_NetWorkCard.top = m_rtNetWorkCardPane.top + vDistance;
	rt_NetWorkCard.right = rt_NetWorkCard.left + TextWidth;
	rt_NetWorkCard.bottom = rt_NetWorkCard.top + TextHeight;
	m_stcNetWorkCard = new CStatic;//CRect(490, 305, 580, 325)
	m_stcNetWorkCard->Create(_T("网卡"), WS_CHILD | WS_VISIBLE, rt_NetWorkCard, this, NETWORKCARDID);
	m_stcNetWorkCard->SetFont(&m_font);

	CRect rt_Memory;
	rt_Memory.left = m_rtMemoryPane.left + hDistance;
	rt_Memory.top = m_rtMemoryPane.top + vDistance;
	rt_Memory.right = rt_Memory.left + TextWidth;
	rt_Memory.bottom = rt_Memory.top + TextHeight;
	m_stcMemory = new CStatic;//CRect(660, 405, 750, 425)//CRect(830, 405, 920, 425)
	m_stcMemory->Create(_T("内存"), WS_CHILD | WS_VISIBLE, rt_Memory, this, MEMORYID);
	m_stcMemory->SetFont(&m_font);


	CRect rt_PathInfoShare;
	rt_PathInfoShare.left = m_rtPathInfoPane.left + hDistance;
	rt_PathInfoShare.top = m_rtPathInfoPane.top + vDistance;
	rt_PathInfoShare.right = rt_PathInfoShare.left + TextWidth;
	rt_PathInfoShare.bottom = rt_PathInfoShare.top + TextHeight;
	m_stcPathInfoTrace = new CStatic;//CRect(490, 405, 580, 425)
	m_stcPathInfoTrace->Create(_T("系统补丁"), WS_CHILD | WS_VISIBLE, rt_PathInfoShare, this, PATHINFOTRACEID);
	m_stcPathInfoTrace->SetFont(&m_font);

	CRect rt_Process;
	rt_Process.left = m_rtProcessPane.left + hDistance;
	rt_Process.top = m_rtProcessPane.top + vDistance;
	rt_Process.right = rt_Process.left + TextWidth;
	rt_Process.bottom = rt_Process.top + TextHeight;
	m_stcProcess = new CStatic;//CRect(660, 305, 750, 325)
	m_stcProcess->Create(_T("进程"), WS_CHILD|WS_VISIBLE, rt_Process, this, PROCESSID);
	m_stcProcess->SetFont(&m_font);

	CRect rt_Service;
	rt_Service.left = m_rtServicePane.left + hDistance;
	rt_Service.top = m_rtServicePane.top + vDistance;
	rt_Service.right = rt_Service.left + TextWidth;
	rt_Service.bottom = rt_Service.top + TextHeight;
	m_stcService = new CStatic;//CRect(830, 305, 920, 325)
	m_stcService->Create(_T("服务"), WS_CHILD|WS_VISIBLE, rt_Service, this, SERVICEID);
	m_stcService->SetFont(&m_font);

	CRect rt_StartUp;
	rt_StartUp.left = m_rtStartUpPane.left + hDistance;
	rt_StartUp.top = m_rtStartUpPane.top + vDistance;
	rt_StartUp.right = rt_StartUp.left + TextWidth;
	rt_StartUp.bottom = rt_StartUp.top + TextHeight;
	m_stcStartUpTrace = new CStatic;//CRect(830, 305, 920, 325)
	m_stcStartUpTrace->Create(_T("启动项"), WS_CHILD|WS_VISIBLE, rt_StartUp,this, STARTUPTRACEID);
	m_stcStartUpTrace->SetFont(&m_font);

	CRect rt_Hardware;
	rt_Hardware.left = m_rtHardwarePane.left + hDistance;
	rt_Hardware.top = m_rtHardwarePane.top + vDistance;
	rt_Hardware.right = rt_Hardware.left + TextWidth;
	rt_Hardware.bottom = rt_Hardware.top + TextHeight;
	m_stcHardware = new CStatic;//CRect(830, 305, 920, 325)
	m_stcHardware->Create(_T("硬件信息"), WS_CHILD | WS_VISIBLE, rt_Hardware, this, HARDWAREID);
	m_stcHardware->SetFont(&m_font);


	CRect rt_TaskList;
	rt_TaskList.left = m_rtTaskListPane.left + hDistance;
	rt_TaskList.top = m_rtTaskListPane.top + vDistance;
	rt_TaskList.right = rt_TaskList.left + TextWidth;
	rt_TaskList.bottom = rt_TaskList.top + TextHeight;
	m_stcTaskListTrace = new CStatic;//CRect(830, 305, 920, 325)
	m_stcTaskListTrace->Create(_T("计划任务"), WS_CHILD|WS_VISIBLE, rt_TaskList,this, TASKLISTTRACEID);
	m_stcTaskListTrace->SetFont(&m_font);

	CRect rt_SoftWare;
	rt_SoftWare.left = m_rtSoftWarePane.left + hDistance;
	rt_SoftWare.top = m_rtSoftWarePane.top + vDistance;
	rt_SoftWare.right = rt_SoftWare.left + TextWidth;
	rt_SoftWare.bottom = rt_SoftWare.top + TextHeight;
	m_stcSoftWare = new CStatic;//CRect(150, 405, 240, 425)
	m_stcSoftWare->Create(_T("安装软件"), WS_CHILD|WS_VISIBLE, rt_SoftWare, this, SERVICEID);
	m_stcSoftWare->SetFont(&m_font);


	CRect rt_Wireless;
	rt_Wireless.left = m_rtWirelessPane.left + hDistance;
	rt_Wireless.top = m_rtWirelessPane.top + vDistance;
	rt_Wireless.right = rt_Wireless.left + TextWidth * 2;
	rt_Wireless.bottom = rt_Wireless.top + TextHeight;
	m_stcWireless = new CStatic;//CRect(150, 405, 240, 425)
	m_stcWireless->Create(_T("无线通讯设备"), WS_CHILD | WS_VISIBLE, rt_Wireless, this, WIRELESSID);
	m_stcWireless->SetFont(&m_font);

	CRect rt_Clipboard;
	rt_Clipboard.left = m_rtClipboardPane.left + hDistance;
	rt_Clipboard.top = m_rtClipboardPane.top + vDistance;
	rt_Clipboard.right = rt_Clipboard.left + TextWidth;
	rt_Clipboard.bottom = rt_Clipboard.top + TextHeight;
	m_stcClipboard = new CStatic;//CRect(660, 405, 750, 425)//CRect(830, 405, 920, 425)
	m_stcClipboard->Create(_T("剪切板内容"), WS_CHILD | WS_VISIBLE, rt_Clipboard, this, CLIPBOARDID);
	m_stcClipboard->SetFont(&m_font);

	CRect rt_SecBaseLine;
	rt_SecBaseLine.left = m_rtAccountPane.left + hDistance;
	rt_SecBaseLine.top = m_rtAccountPane.top + vDistance;
	rt_SecBaseLine.right = rt_SecBaseLine.left + TextWidth;
	rt_SecBaseLine.bottom = rt_SecBaseLine.top + TextHeight;
	m_stcAccountSec = new CStatic;//CRect(320, 405, 410, 425)
	m_stcAccountSec->Create(_T("安全基线"), WS_CHILD|WS_VISIBLE, rt_SecBaseLine, this, ACCOUNTSECID);
	m_stcAccountSec->SetFont(&m_font);

	CRect rt_FileShare;
	rt_FileShare.left = m_rtFileSharePane.left + hDistance;
	rt_FileShare.top = m_rtFileSharePane.top + vDistance;
	rt_FileShare.right = rt_FileShare.left + TextWidth;
	rt_FileShare.bottom = rt_FileShare.top + TextHeight;
	m_stcFileShare = new CStatic;//CRect(490, 405, 580, 425)
	m_stcFileShare->Create(_T("文件共享"), WS_CHILD|WS_VISIBLE, rt_FileShare, this, FILESHAREID);
	m_stcFileShare->SetFont(&m_font);

	CRect rt_LogPolicyShare;
	rt_LogPolicyShare.left = m_rtLogPolicyPane.left + hDistance;
	rt_LogPolicyShare.top = m_rtLogPolicyPane.top + vDistance;
	rt_LogPolicyShare.right = rt_LogPolicyShare.left + TextWidth * 2;
	rt_LogPolicyShare.bottom = rt_LogPolicyShare.top + TextHeight;
	m_stcLogPolicyTrace = new CStatic;//CRect(490, 405, 580, 425)
	m_stcLogPolicyTrace->Create(_T("日志策略"), WS_CHILD|WS_VISIBLE, rt_LogPolicyShare, this, LOGPOLICYTRACEID);
	m_stcLogPolicyTrace->SetFont(&m_font);

	

	CRect rt_USBTrace;
	rt_USBTrace.left = m_rtUSBPane.left + hDistance;
	rt_USBTrace.top = m_rtUSBPane.top + vDistance;
	rt_USBTrace.right = rt_USBTrace.left + TextWidth * 2;
	rt_USBTrace.bottom = rt_USBTrace.top + TextHeight;
	m_stcUSBTrace = new CStatic;//CRect(830, 405, 920, 425)//CRect(660, 405, 750, 425)
	m_stcUSBTrace->Create(_T("USB插拔记录"), WS_CHILD|WS_VISIBLE, rt_USBTrace, this, USBTRACEID);
	m_stcUSBTrace->SetFont(&m_font);

	CRect rt_ARPTrace;
	rt_ARPTrace.left = m_rtarpPane.left + hDistance;
	rt_ARPTrace.top = m_rtarpPane.top + vDistance;
	rt_ARPTrace.right = rt_ARPTrace.left + TextWidth * 2;
	rt_ARPTrace.bottom = rt_ARPTrace.top + TextHeight;
	m_stcARPTrace = new CStatic;//CRect(830, 405, 920, 425)//CRect(660, 405, 750, 425)
	m_stcARPTrace->Create(_T("ARP记录"), WS_CHILD|WS_VISIBLE, rt_ARPTrace, this, ARPTRACEID);
	m_stcARPTrace->SetFont(&m_font);

	CRect rt_DNSTrace;
	rt_DNSTrace.left = m_rtDNSPane.left + hDistance;
	rt_DNSTrace.top = m_rtDNSPane.top + vDistance;
	rt_DNSTrace.right = rt_DNSTrace.left + TextWidth * 2;
	rt_DNSTrace.bottom = rt_DNSTrace.top + TextHeight;
	m_stcDNSTrace = new CStatic;//CRect(830, 405, 920, 425)//CRect(660, 405, 750, 425)
	m_stcDNSTrace->Create(_T("DNS记录"), WS_CHILD|WS_VISIBLE, rt_DNSTrace, this, DNSTRACEID);
	m_stcDNSTrace->SetFont(&m_font);

	CRect rt_FileInfoTrace;
	rt_FileInfoTrace.left = m_rtFileInfoPane.left + hDistance;
	rt_FileInfoTrace.top = m_rtFileInfoPane.top + vDistance;
	rt_FileInfoTrace.right = rt_FileInfoTrace.left + TextWidth * 2;
	rt_FileInfoTrace.bottom = rt_FileInfoTrace.top + TextHeight;
	m_stcFileInfoTrace = new CStatic;//CRect(830, 405, 920, 425)//CRect(660, 405, 750, 425)
	m_stcFileInfoTrace->Create(_T("磁盘文件"), WS_CHILD|WS_VISIBLE, rt_FileInfoTrace, this, FILEINFOTRACEID);
	m_stcFileInfoTrace->SetFont(&m_font);


	CRect rt_DbLog;
	rt_DbLog.left = m_rtDBLogPane.left + hDistance;
	rt_DbLog.top = m_rtDBLogPane.top + vDistance;
	rt_DbLog.right = rt_DbLog.left + TextWidth * 2;
	rt_DbLog.bottom = rt_DbLog.top + TextHeight;
	m_stcDbLogTrace = new CStatic;//CRect(660, 405, 750, 425)//CRect(830, 405, 920, 425)
	m_stcDbLogTrace->Create(_T("日志采集"), WS_CHILD|WS_VISIBLE, rt_DbLog, this, DBLOGTRACEID);
	m_stcDbLogTrace->SetFont(&m_font);

	
	
	CRect rt_AllSel1;
	rt_AllSel1.left = m_rtPaneAllSel1.left + hDistance;
	rt_AllSel1.top = m_rtPaneAllSel1.top + vDistance;
	rt_AllSel1.right = rt_AllSel1.left + TextWidth * 3;
	rt_AllSel1.bottom = rt_AllSel1.top + TextHeight ;
	m_stcAllSelCol1 = new CStatic;//200 510
	m_stcAllSelCol1->Create(_T("主机资产采集分析"), WS_CHILD|WS_VISIBLE, rt_AllSel1, this, OPTALLSEL);
	m_stcAllSelCol1->SetFont(&m_font);

	CRect rt_AllSel2;
	rt_AllSel2.left = m_rtPaneAllSel2.left + hDistance;
	rt_AllSel2.top = m_rtPaneAllSel2.top + vDistance;
	rt_AllSel2.right = rt_AllSel2.left + TextWidth * 3;
	rt_AllSel2.bottom = rt_AllSel2.top + TextHeight ;
	m_stcAllSelCol2 = new CStatic;
	m_stcAllSelCol2->Create(_T("系统信息采集分析"), WS_CHILD|WS_VISIBLE, rt_AllSel2, this, OPTALLSEL2);
	m_stcAllSelCol2->SetFont(&m_font);

	CRect rt_AllSel3;
	rt_AllSel3.left = m_rtPaneAllSel3.left + hDistance;
	rt_AllSel3.top = m_rtPaneAllSel3.top + vDistance;
	rt_AllSel3.right = rt_AllSel3.left + TextWidth * 3;
	rt_AllSel3.bottom = rt_AllSel3.top + TextHeight ;
	m_stcAllSelCol3 = new CStatic;
	m_stcAllSelCol3->Create(_T("web信息采集分析"), WS_CHILD|WS_VISIBLE, rt_AllSel3, this, OPTALLSEL3);
	m_stcAllSelCol3->SetFont(&m_font);

	CRect rt_AllSel4;
	rt_AllSel4.left = m_rtPaneAllSel4.left + hDistance;
	rt_AllSel4.top = m_rtPaneAllSel4.top + vDistance;
	rt_AllSel4.right = rt_AllSel4.left + TextWidth * 3;
	rt_AllSel4.bottom = rt_AllSel4.top + TextHeight;
	m_stcAllSelCol4 = new CStatic;
	m_stcAllSelCol4->Create(_T("数据库日志采集分析"), WS_CHILD | WS_VISIBLE, rt_AllSel4, this, OPTALLSEL3);
	m_stcAllSelCol4->SetFont(&m_font);

	CRect rt_AllSel5;
	rt_AllSel5.left = m_rtPaneAllSel5.left + hDistance;
	rt_AllSel5.top = m_rtPaneAllSel5.top + vDistance;
	rt_AllSel5.right = rt_AllSel5.left + TextWidth * 3;
	rt_AllSel5.bottom = rt_AllSel5.top + TextHeight;
	m_stcAllSelCol5 = new CStatic;
	m_stcAllSelCol5->Create(_T("Windows日志采集分析"), WS_CHILD | WS_VISIBLE, rt_AllSel5, this, OPTALLSEL3);
	m_stcAllSelCol5->SetFont(&m_font);

	CRect rt_AllSel6;
	rt_AllSel6.left = m_rtPaneAllSel6.left + hDistance;
	rt_AllSel6.top = m_rtPaneAllSel6.top + vDistance;
	rt_AllSel6.right = rt_AllSel6.left + TextWidth * 3;
	rt_AllSel6.bottom = rt_AllSel6.top + TextHeight;
	m_stcAllSelCol6 = new CStatic;
	m_stcAllSelCol6->Create(_T("磁盘文件信息采集分析"), WS_CHILD | WS_VISIBLE, rt_AllSel6, this, OPTALLSEL3);
	m_stcAllSelCol6->SetFont(&m_font);

	CRect rt_AllSel7;
	rt_AllSel7.left = m_rtPaneAllSel7.left + hDistance;
	rt_AllSel7.top = m_rtPaneAllSel7.top + vDistance;
	rt_AllSel7.right = rt_AllSel7.left + TextWidth * 3;
	rt_AllSel7.bottom = rt_AllSel7.top + TextHeight;
	m_stcAllSelCol7 = new CStatic;
	m_stcAllSelCol7->Create(_T("其他信息采集分析"), WS_CHILD | WS_VISIBLE, rt_AllSel7, this, OPTALLSEL3);
	m_stcAllSelCol7->SetFont(&m_font);
	return 0;
}



HBRUSH CPage4::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
	HBRUSH hbr = CWnd::OnCtlColor(pDC, pWnd, nCtlColor);

	// TODO:  Change any attributes of the DC here
	switch(nCtlColor)
	{
	case CTLCOLOR_STATIC:
		{
			pDC->SetBkMode(TRANSPARENT);
			//pDC->SetTextColor(RGB(255,255,255));
			return   (HBRUSH)::GetStockObject(NULL_BRUSH); 
		}
	default:
		return hbr;
	}


	// TODO:  Return a different brush if the default is not desired
	
}


void CPage4::OnLButtonDown(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	GetCursorPos(&m_LBtnDownPos);
	//CString str;
	//str.Format(_T("x=%d,y=%d"), m_LBtnDownPos.x,m_LBtnDownPos.y);
	//AfxMessageBox(str);
	CRect rt0(0, 0, 1000, 45);
	CRect rtWEB(335, 20, 455, 45);
	CRect rtVirus(750, 20, 870, 45);
	ClientToScreen(rt0);
	ClientToScreen(rtWEB);
	ClientToScreen(rtVirus);
	if(rt0.PtInRect(m_LBtnDownPos) && !rtWEB.PtInRect(m_LBtnDownPos) && !rtVirus.PtInRect(m_LBtnDownPos))
	{
		//使鼠标可以拖动窗口
		m_pView->GetParent()->SendMessage(WM_SYSCOMMAND,SC_MOVE|HTCAPTION,0);
	}

	CWnd::OnLButtonDown(nFlags, point);
}




void CPage4::OnLButtonUp(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	GetCursorPos(&m_LBtnUpPos);

	CRect rtWEB(m_rtWEBPane);
	CRect rtHostLog(m_rtHostLogPane);
	CRect rtFileOperation(m_rtFileOperationPane);
	CRect rtInter(m_rtInterPane);
	CRect rtPort(m_rtPortPane);
	CRect rtProcess(m_rtProcessPane);
	CRect rtService(m_rtServicePane);
	CRect rtSoftWare(m_rtSoftWarePane);
	CRect rtAccount(m_rtAccountPane);
	CRect rtFileShare(m_rtFileSharePane);
	CRect rtUSB(m_rtUSBPane);
	CRect rtMemory(m_rtMemoryPane);
	CRect rt15(m_rtPaneAllSel1);
	CRect rtUSN(m_rtUSNPane);
	CRect rtArp(m_rtarpPane);
	CRect rtDns(m_rtDNSPane);
	CRect rtStartUp(m_rtStartUpPane);
	CRect rtTaskList(m_rtTaskListPane);
	CRect rtLogPolicy(m_rtLogPolicyPane);
	CRect rtPathInfo(m_rtPathInfoPane);
	CRect rtFileInfo(m_rtFileInfoPane);
	CRect rtHostBase(m_rtHostBasePane);
	CRect rtDBlog(m_rtDBLogPane);
	CRect rtNetWorkCard(m_rtNetWorkCardPane);
	CRect rt_disk1(m_rtDisk1);
	CRect rt_disk2(m_rtDisk2);
	CRect rt_disk3(m_rtDisk3);
	CRect rt_disk4(m_rtDisk4);
	CRect rt_disk5(m_rtDisk5);
	CRect rt_disk6(m_rtDisk6);
	CRect rt_disk7(m_rtDisk7);
	CRect rt_disk8(m_rtDisk8);
	CRect rt_diskall(m_rtDiskAll);
	CRect rt_ALLselCol1(m_rtPaneAllSel1);
	CRect rt_ALLselCol2(m_rtPaneAllSel2);
	CRect rt_AllSecCol3(m_rtPaneAllSel3);
	CRect rt_AllSecCol4(m_rtPaneAllSel4);
	CRect rt_AllSecCol5(m_rtPaneAllSel5);
	CRect rt_AllSecCol6(m_rtPaneAllSel6);
	CRect rt_AllSecCol7(m_rtPaneAllSel7);
	CRect rtHardware(m_rtHardwarePane);
	CRect rtWireless(m_rtWirelessPane);
	CRect rtClipboard(m_rtClipboardPane);


	ClientToScreen(rtClipboard);
	ClientToScreen(rtWireless);
	ClientToScreen(rtWEB);
	ClientToScreen(rtHostLog);
	ClientToScreen(rtFileOperation);
	ClientToScreen(rtInter);
	ClientToScreen(rtPort);
	ClientToScreen(rtProcess);
	ClientToScreen(rtService);
	ClientToScreen(rtSoftWare);
	ClientToScreen(rtAccount);
	ClientToScreen(rtFileShare);
	ClientToScreen(rtUSB);
	ClientToScreen(rtMemory);
	ClientToScreen(rt15);
	ClientToScreen(rtUSN);
	ClientToScreen(rtArp);
	ClientToScreen(rtDns);
	ClientToScreen(rtHardware);
	ClientToScreen(rtLogPolicy);
	ClientToScreen(rtPathInfo);
	ClientToScreen(rtFileInfo);
	ClientToScreen(rtStartUp);
	ClientToScreen(rtTaskList);
	ClientToScreen(rtHostBase);
	ClientToScreen(rtNetWorkCard);
	ClientToScreen(rt_disk1);
	ClientToScreen(rt_disk2);
	ClientToScreen(rt_disk3);
	ClientToScreen(rt_disk4);
	ClientToScreen(rt_disk5);
	ClientToScreen(rt_disk6);
	ClientToScreen(rt_disk7);
	ClientToScreen(rt_disk8);
	ClientToScreen(rt_diskall);
	ClientToScreen(rt_ALLselCol1);
	ClientToScreen(rt_ALLselCol2);
	ClientToScreen(rt_AllSecCol3);
	ClientToScreen(rt_AllSecCol4);
	ClientToScreen(rt_AllSecCol5);
	ClientToScreen(rt_AllSecCol6);
	ClientToScreen(rt_AllSecCol7);

	ClientToScreen(rtDBlog);
	CRect rt_cancel(m_rtCancelBtn);
	CRect rt_ok(m_rtOKBtn);
	ClientToScreen(rt_cancel);
	ClientToScreen(rt_ok);
	if(rt_cancel.PtInRect(m_LBtnDownPos) && rt_cancel.PtInRect(m_LBtnUpPos))
	{	
		// 取消按钮
		CTOOLBOX4View::PAGE = 1;
		m_pView->SendMessage(WM_MY_PAGECHANGE);
	}
	if(rt_ok.PtInRect(m_LBtnDownPos) && rt_ok.PtInRect(m_LBtnUpPos))
	{
		// 确定按钮
		SYSTEMTIME begtime;
		SYSTEMTIME endtime;
		SYSTEMTIME curtime;
		GetLocalTime(&curtime);
		m_pBeginTime->GetTime(&begtime);
		m_pEndTime->GetTime(&endtime);
		m_pBeginTime->GetTime(m_stBegTime);
		m_pEndTime->GetTime(m_stEndTime);

		if(((endtime.wYear > curtime.wYear) || (endtime.wYear>= curtime.wYear && endtime.wMonth >curtime.wMonth) || (endtime.wYear>=curtime.wYear && endtime.wMonth >= curtime.wMonth && endtime.wDay > curtime.wDay)) || 
			((begtime.wYear > endtime.wYear) || (begtime.wYear>= endtime.wYear && begtime.wMonth >endtime.wMonth) || (begtime.wYear>=endtime.wYear && begtime.wMonth >= endtime.wMonth && begtime.wDay > endtime.wDay)))
		{
			//AfxMessageBox(_T("时间错误! 请重新输入起始时间和结束时间!"));
			MessageBox(_T("请重新输入起始时间和结束时间!"), _T("时间错误!"), MB_ICONERROR);
			return;
		}

		// 当选择了 Web检测,病毒检测,联网痕迹,介质痕迹 就必须选择盘符
		if(m_bIsWEBSel || m_bIsVirusSel || m_bIsInterSel ||m_bIsUSNSel||m_bIsFileInfoSel)
		{
			if(!m_bIsDisk1 && !m_bIsDisk2 && !m_bIsDisk3 && !m_bIsDisk4 && !m_bIsDisk5 && !m_bIsDisk6
				&& !m_bIsDisk7 && !m_bIsDisk8)
			{
				MessageBox(_T("请选择盘符!"), _T("提示:"), MB_ICONINFORMATION);
				return;
			}
		}


		if(m_bIsShowDisk1 && m_bIsDisk1)
			m_strSelDisk += m_strDisk.Mid(0, 3);
		if(m_bIsShowDisk2 && m_bIsDisk2)
			m_strSelDisk += m_strDisk.Mid(3, 3);
		if(m_bIsShowDisk3 && m_bIsDisk3)
			m_strSelDisk += m_strDisk.Mid(6, 3);
		if(m_bIsShowDisk4 && m_bIsDisk4)
			m_strSelDisk += m_strDisk.Mid(9, 3);
		if(m_bIsShowDisk5 && m_bIsDisk5)
			m_strSelDisk += m_strDisk.Mid(12, 3);
		if(m_bIsShowDisk6 && m_bIsDisk6)
			m_strSelDisk += m_strDisk.Mid(15, 3);
		if(m_bIsShowDisk7 && m_bIsDisk7)
			m_strSelDisk += m_strDisk.Mid(18, 3);
		if(m_bIsShowDisk8 && m_bIsDisk8)
			m_strSelDisk += m_strDisk.Mid(21, 3);
		//CString str;
		//str.Format(_T("%s"), m_strDisk.Mid(2,1));
		//AfxMessageBox(m_strSelDisk);
		//AfxMessageBox(m_strDisk);
		CTOOLBOX4View::PAGE = 5;
		m_pView->SendMessage(WM_MY_PAGECHANGE);

		CReport::InitHostOpt();

		m_pPage5->m_pShare->m_stcWebFileStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcHostLogStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcAnalyzeStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcFileTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcNetTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcPortStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcProcessStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcServiceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcSoftWareStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcAccountSecStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcFileShareStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcUSBTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcUSNTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcDNSTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcLogPolicyTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcPathInfoTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcFileInfoTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcStartUpInfoTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcTaskInfoTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcHostBaseInfoTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcDBLogTraceStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcWirelessStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcHardwareStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcMemoryStat->ShowWindow(SW_HIDE);
		m_pPage5->m_pShare->m_stcClipboardStat->ShowWindow(SW_HIDE);
		//if(CTOOLBOX4App::m_bIsLuJun)
		//	CPage1::m_bIsShowConvertBtn = TRUE;

		AFX_THREADPROC MyFunc = MyThreadFunc_Custom;
		CWinThread* MyThread1 = AfxBeginThread(MyFunc, this , THREAD_PRIORITY_NORMAL , 0 , 0 , NULL);
		//AFX_THREADPROC MyGetFileFunc=myGetFileListpage4;
		//MyThread2 = AfxBeginThread(MyGetFileFunc, this , THREAD_PRIORITY_NORMAL , 0 , 0 , NULL);

	}
	if(m_bIsShowDisk1 && rt_disk1.PtInRect(m_LBtnDownPos) && rt_disk1.PtInRect(m_LBtnUpPos))
	{
		m_bIsDisk1 = !m_bIsDisk1;
		Invalidate();
	}
	if(m_bIsShowDisk2 && rt_disk2.PtInRect(m_LBtnDownPos) && rt_disk2.PtInRect(m_LBtnUpPos))
	{
		m_bIsDisk2 = !m_bIsDisk2;
		Invalidate();
	}
	if(m_bIsShowDisk3 && rt_disk3.PtInRect(m_LBtnDownPos) && rt_disk3.PtInRect(m_LBtnUpPos))
	{
		m_bIsDisk3 = !m_bIsDisk3;
		Invalidate();
	}
	if(m_bIsShowDisk4 && rt_disk4.PtInRect(m_LBtnDownPos) && rt_disk4.PtInRect(m_LBtnUpPos))
	{
		m_bIsDisk4 = !m_bIsDisk4;
		Invalidate();
	}
	if(m_bIsShowDisk5 && rt_disk5.PtInRect(m_LBtnDownPos) && rt_disk5.PtInRect(m_LBtnUpPos))
	{
		m_bIsDisk5 = !m_bIsDisk5;
		Invalidate();
	}
	if(m_bIsShowDisk6 && rt_disk6.PtInRect(m_LBtnDownPos) && rt_disk6.PtInRect(m_LBtnUpPos))
	{
		m_bIsDisk6 = !m_bIsDisk6;
		Invalidate();
	}
	if(m_bIsShowDisk7 && rt_disk7.PtInRect(m_LBtnDownPos) && rt_disk7.PtInRect(m_LBtnUpPos))
	{
		m_bIsDisk7 = !m_bIsDisk7;
		Invalidate();
	}
	if(m_bIsShowDisk8 && rt_disk8.PtInRect(m_LBtnDownPos) && rt_disk8.PtInRect(m_LBtnUpPos))
	{
		m_bIsDisk8 = !m_bIsDisk8;
		Invalidate();
	}
	if(rt_diskall.PtInRect(m_LBtnDownPos) && rt_diskall.PtInRect(m_LBtnUpPos))
	{
		if(m_bIsAllSel == FALSE)
		{
			m_bIsAllSel = TRUE;
			if(m_bIsShowDisk1)
				m_bIsDisk1 = TRUE;
			if(m_bIsShowDisk2)
				m_bIsDisk2 = TRUE;
			if(m_bIsShowDisk3)
				m_bIsDisk3 = TRUE;
			if(m_bIsShowDisk4)
				m_bIsDisk4 = TRUE;
			if(m_bIsShowDisk5)
				m_bIsDisk5 = TRUE;
			if(m_bIsShowDisk6)
				m_bIsDisk6 = TRUE;
			if(m_bIsShowDisk7)
				m_bIsDisk7 = TRUE;
			if(m_bIsShowDisk8)
				m_bIsDisk8 = TRUE;
			Invalidate();
		}
		else
		{
			m_bIsAllSel = FALSE;
			if(m_bIsShowDisk1)
				m_bIsDisk1 = FALSE;
			if(m_bIsShowDisk2)
				m_bIsDisk2 = FALSE;
			if(m_bIsShowDisk3)
				m_bIsDisk3 = FALSE;
			if(m_bIsShowDisk4)
				m_bIsDisk4 = FALSE;
			if(m_bIsShowDisk5)
				m_bIsDisk5 = FALSE;
			if(m_bIsShowDisk6)
				m_bIsDisk6 = FALSE;
			if(m_bIsShowDisk7)
				m_bIsDisk7 = FALSE;
			if(m_bIsShowDisk8)
				m_bIsDisk8 = FALSE;
			Invalidate();
		}
	}

	if(rtWEB.PtInRect(m_LBtnDownPos) && rtWEB.PtInRect(m_LBtnUpPos))
	{
		// Web检测
		m_bIsWEBSel = !m_bIsWEBSel;
		ScreenToClient(rtWEB);
		InvalidateRect(&rtWEB);
	}
	if(rtHostLog.PtInRect(m_LBtnDownPos) && rtHostLog.PtInRect(m_LBtnUpPos))
	{
		// 主机日志
		m_bIsHostLogSel = !m_bIsHostLogSel;
		ScreenToClient(rtHostLog);
		InvalidateRect(&rtHostLog);
	}
	if(rtFileOperation.PtInRect(m_LBtnDownPos) && rtFileOperation.PtInRect(m_LBtnUpPos))
	{
		// 文件操作痕迹
		m_bIsFileOperationSel = !m_bIsFileOperationSel;
		ScreenToClient(rtFileOperation);
		InvalidateRect(&rtFileOperation);
	}
	if(rtHostBase.PtInRect(m_LBtnDownPos) && rtHostBase.PtInRect(m_LBtnUpPos))
	{
		// 主机信息
		m_bIsHostBaseSel = !m_bIsHostBaseSel;
		ScreenToClient(rtHostBase);
		InvalidateRect(&rtHostBase);
	}
	if (rtNetWorkCard.PtInRect(m_LBtnDownPos) && rtNetWorkCard.PtInRect(m_LBtnUpPos))
	{
		// 网卡
		m_bIsNetWorkCardSel = !m_bIsNetWorkCardSel;
		ScreenToClient(rtNetWorkCard);
		InvalidateRect(&rtNetWorkCard);
	}
	if(rtInter.PtInRect(m_LBtnDownPos) && rtInter.PtInRect(m_LBtnUpPos))
	{
		// 联网痕迹
		m_bIsInterSel = !m_bIsInterSel;
		ScreenToClient(rtInter);
		InvalidateRect(&rtInter);
	}
	if(rtPort.PtInRect(m_LBtnDownPos) && rtPort.PtInRect(m_LBtnUpPos))
	{
		// 网络连接
		m_bIsPortSel = !m_bIsPortSel;
		ScreenToClient(rtPort);
		InvalidateRect(&rtPort);
	}
	if(rtProcess.PtInRect(m_LBtnDownPos) && rtProcess.PtInRect(m_LBtnUpPos))
	{
		// 进程
		m_bIsProcessSel = !m_bIsProcessSel;
		ScreenToClient(rtProcess);
		InvalidateRect(&rtProcess);
	}
	if(rtService.PtInRect(m_LBtnDownPos) && rtService.PtInRect(m_LBtnUpPos))
	{
		// 服务
		m_bIsServiceSel = !m_bIsServiceSel;
		ScreenToClient(rtService);
		InvalidateRect(&rtService);
	}
	if(rtStartUp.PtInRect(m_LBtnDownPos) && rtStartUp.PtInRect(m_LBtnUpPos))
	{
		// 启动项
		m_bIsStartUpSel = !m_bIsStartUpSel;
		ScreenToClient(rtStartUp);
		InvalidateRect(&rtStartUp);
	}
	if(rtTaskList.PtInRect(m_LBtnDownPos) && rtTaskList.PtInRect(m_LBtnUpPos))
	{
		// 计划任务
		m_bIsTaskListSel = !m_bIsTaskListSel;
		ScreenToClient(rtTaskList);
		InvalidateRect(&rtTaskList);
	}
	if(rtSoftWare.PtInRect(m_LBtnDownPos) && rtSoftWare.PtInRect(m_LBtnUpPos))
	{
		// 安装软件
		m_bIsSoftWareSel = !m_bIsSoftWareSel;
		ScreenToClient(rtSoftWare);
		InvalidateRect(&rtSoftWare);
	}
	if(rtAccount.PtInRect(m_LBtnDownPos) && rtAccount.PtInRect(m_LBtnUpPos))
	{
		// 安全基线
		m_bIsAccountSel = !m_bIsAccountSel;
		ScreenToClient(rtAccount);
		InvalidateRect(&rtAccount);
	}
	if(rtFileShare.PtInRect(m_LBtnDownPos) && rtFileShare.PtInRect(m_LBtnUpPos))
	{
		// 文件共享
		m_bIsFileShareSel = !m_bIsFileShareSel;
		ScreenToClient(rtFileShare);
		InvalidateRect(&rtFileShare);
	}
	if(rtLogPolicy.PtInRect(m_LBtnDownPos) && rtLogPolicy.PtInRect(m_LBtnUpPos))
	{
		// 日志策略
		m_bIsLogPolicySel = !m_bIsLogPolicySel;
		ScreenToClient(rtLogPolicy);
		InvalidateRect(&rtLogPolicy);
	}
	if(rtPathInfo.PtInRect(m_LBtnDownPos) && rtPathInfo.PtInRect(m_LBtnUpPos))
	{
		// 系统补丁
		m_bIsPathInfoSel = !m_bIsPathInfoSel;
		ScreenToClient(rtPathInfo);
		InvalidateRect(&rtPathInfo);
	}
	if(rtUSB.PtInRect(m_LBtnDownPos) && rtUSB.PtInRect(m_LBtnUpPos))
	{
		// USB插拔记录
		m_bIsUSBSel = !m_bIsUSBSel;
		ScreenToClient(rtUSB);
		InvalidateRect(&rtUSB);
	}
	if(rtUSN.PtInRect(m_LBtnDownPos) && rtUSN.PtInRect(m_LBtnUpPos))
	{
		// USN记录
		m_bIsUSNSel = !m_bIsUSNSel;
		ScreenToClient(rtUSN);
		InvalidateRect(&rtUSN);
	}
	if(rtFileInfo.PtInRect(m_LBtnDownPos) && rtFileInfo.PtInRect(m_LBtnUpPos))
	{
		// USN记录
		m_bIsFileInfoSel = !m_bIsFileInfoSel;
		ScreenToClient(rtFileInfo);
		InvalidateRect(&rtFileInfo);
	}
	if(rtArp.PtInRect(m_LBtnDownPos) && rtArp.PtInRect(m_LBtnUpPos))
	{
		// arp记录
		m_bIsARPSel = !m_bIsARPSel;
		ScreenToClient(rtArp);
		InvalidateRect(&rtArp);
	}
	if(rtDns.PtInRect(m_LBtnDownPos) && rtDns.PtInRect(m_LBtnUpPos))
	{
		// dns记录
		m_bIsDNSSel = !m_bIsDNSSel;
		ScreenToClient(rtDns);
		InvalidateRect(&rtDns);
	}
	if(rtMemory.PtInRect(m_LBtnDownPos) && rtMemory.PtInRect(m_LBtnUpPos))
	{
		// 内存镜像
		m_bIsMemorySel = !m_bIsMemorySel;
		ScreenToClient(rtMemory);
		InvalidateRect(&rtMemory);
	}
	if (rtHardware.PtInRect(m_LBtnDownPos) && rtHardware.PtInRect(m_LBtnUpPos))
	{
		// 硬件信息
		m_bIsHardwareSel = !m_bIsHardwareSel;
		ScreenToClient(rtHardware);
		InvalidateRect(&rtHardware);
	}
	if (rtWireless.PtInRect(m_LBtnDownPos) && rtWireless.PtInRect(m_LBtnUpPos))
	{
		// 无线通讯设备
		m_bIsWirelessSel = !m_bIsWirelessSel;
		ScreenToClient(rtWireless);
		InvalidateRect(&rtWireless);
	}

	if (rtClipboard.PtInRect(m_LBtnDownPos) && rtClipboard.PtInRect(m_LBtnUpPos))
	{
		// 剪切板内容
		m_bIsClipboardSel = !m_bIsClipboardSel;
		ScreenToClient(rtClipboard);
		InvalidateRect(&rtClipboard);
	}
	if(rtDBlog.PtInRect(m_LBtnDownPos) && rtDBlog.PtInRect(m_LBtnUpPos))
	{
		// 数据库日志采集
		m_bIsDbLogSel = !m_bIsDbLogSel;
		ScreenToClient(rtDBlog);
		InvalidateRect(&rtDBlog);
	}
	//if(rt14.PtInRect(m_LBtnDownPos) && rt14.PtInRect(m_LBtnUpPos))
	//{
	//	综合分析, 始终处于勾选状态
	//	//m_bIsSel13 = !m_bIsSel13;
	//	m_bIsSel14 = !m_bIsSel14;
	//	ScreenToClient(rt14);
	//	InvalidateRect(&rt14);
	//	//Invalidate();
	//}

	if(rt_ALLselCol1.PtInRect(m_LBtnDownPos) && rt_ALLselCol1.PtInRect(m_LBtnUpPos))
	{
		if (m_bIsSelCol1 == FALSE)
		{
			m_bIsSelCol1 = TRUE;

			m_bIsNetWorkCardSel = TRUE;
			m_bIsMemorySel = TRUE;
			m_bIsPathInfoSel = TRUE;
			m_bIsServiceSel = TRUE;
			m_bIsProcessSel = TRUE;
			m_bIsFileOperationSel = TRUE;
			m_bIsPortSel = TRUE;
			m_bIsTaskListSel = TRUE;
			m_bIsStartUpSel = TRUE;
			m_bIsHardwareSel = TRUE;
		}
		else
		{
			m_bIsSelCol1 = FALSE;

			m_bIsNetWorkCardSel = FALSE;
			m_bIsMemorySel = FALSE;
			m_bIsPathInfoSel = FALSE;
			m_bIsServiceSel = FALSE;
			m_bIsProcessSel = FALSE;
			m_bIsFileOperationSel = FALSE;
			m_bIsPortSel = FALSE;
			m_bIsTaskListSel = FALSE;
			m_bIsStartUpSel = FALSE;
			m_bIsHardwareSel = FALSE;
		}
		Invalidate();
	}

	if(rt_ALLselCol2.PtInRect(m_LBtnDownPos) && rt_ALLselCol2.PtInRect(m_LBtnUpPos))
	{
		if(m_bIsSelCol2 == FALSE)
		{
			m_bIsSelCol2 = TRUE;

			m_bIsInterSel = TRUE;
			m_bIsUSBSel = TRUE;
			m_bIsSoftWareSel = TRUE;
			m_bIsWirelessSel = TRUE;
		}
		else
		{
			m_bIsSelCol2 = FALSE;

			m_bIsInterSel = FALSE;
			m_bIsUSBSel = FALSE;
			m_bIsSoftWareSel = FALSE;
			m_bIsWirelessSel = FALSE;
		}
		Invalidate();
	}

	if(rt_AllSecCol3.PtInRect(m_LBtnDownPos) && rt_AllSecCol3.PtInRect(m_LBtnUpPos))
	{
		if(m_bIsSelCol3 == FALSE)
		{
			m_bIsSelCol3 = TRUE;

			m_bIsWEBSel = TRUE;
		}
		else
		{
			m_bIsSelCol3 = FALSE;

			m_bIsWEBSel = FALSE;
		}
		Invalidate();
	}

	if(rt_AllSecCol4.PtInRect(m_LBtnDownPos) && rt_AllSecCol4.PtInRect(m_LBtnUpPos))
	{
		if (m_bIsSelCol4 == FALSE)
		{
			m_bIsSelCol4 = TRUE;

			m_bIsDbLogSel = TRUE;
		}
		else
		{
			m_bIsSelCol4 = FALSE;

			m_bIsDbLogSel = FALSE;
		}
		Invalidate();
	}

	if(rt_AllSecCol5.PtInRect(m_LBtnDownPos) && rt_AllSecCol5.PtInRect(m_LBtnUpPos))
	{
		if (m_bIsSelCol5 == FALSE)
		{
			m_bIsSelCol5 = TRUE;

			m_bIsHostLogSel = TRUE;
		}
		else
		{
			m_bIsSelCol5 = FALSE;

			m_bIsHostLogSel = FALSE;
		}
		Invalidate();
	}

	if(rt_AllSecCol6.PtInRect(m_LBtnDownPos) && rt_AllSecCol6.PtInRect(m_LBtnUpPos))
	{
		if (m_bIsSelCol6 == FALSE)
		{
			m_bIsSelCol6 = TRUE;

			m_bIsUSNSel = TRUE;
			m_bIsFileInfoSel = TRUE;
		}
		else
		{
			m_bIsSelCol6 = FALSE;

			m_bIsUSNSel = FALSE;
			m_bIsFileInfoSel = FALSE;
		}
		Invalidate();
	}

	if(rt_AllSecCol7.PtInRect(m_LBtnDownPos) && rt_AllSecCol7.PtInRect(m_LBtnUpPos))
	{
		if (m_bIsSelCol7 == FALSE)
		{
			m_bIsSelCol7 = TRUE;

			m_bIsFileShareSel = TRUE;
			m_bIsClipboardSel = TRUE;
			m_bIsAccountSel = TRUE;
			m_bIsARPSel = TRUE;
			m_bIsDNSSel = TRUE;
			m_bIsLogPolicySel = TRUE;
		}
		else
		{
			m_bIsSelCol7 = FALSE;

			m_bIsFileShareSel = FALSE;
			m_bIsClipboardSel = FALSE;
			m_bIsAccountSel = FALSE;
			m_bIsARPSel = FALSE;
			m_bIsDNSSel = FALSE;
			m_bIsLogPolicySel = FALSE;
		}
		Invalidate();
	}
	CWnd::OnLButtonUp(nFlags, point);
}

static BOOL flag1 = TRUE;
static BOOL flag2 = FALSE;
static BOOL flag3 = TRUE;
static BOOL flag4 = FALSE;
void CPage4::OnMouseMove(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	CPoint pt;
	GetCursorPos(&pt);
	CRect rt_cancel(m_rtCancelBtn);
	CRect rt_ok(m_rtOKBtn);
	ClientToScreen(rt_cancel);
	ClientToScreen(rt_ok);

	if(rt_cancel.PtInRect(pt))
	{
		if(!flag2)
		{
			InvalidateRect(m_rtCancelBtn);
			flag2 = TRUE;
			flag1 = FALSE;
		}
	}
	else
	{
		if(!flag1)
		{
			InvalidateRect(m_rtCancelBtn);
			flag1 = TRUE;
			flag2 = FALSE;
		}
	}
	if(rt_ok.PtInRect(pt))
	{
		if(!flag4)
		{
			InvalidateRect(m_rtOKBtn);
			flag4 = TRUE;
			flag3 = FALSE;
		}
	}
	else
	{
		if(!flag3)
		{
			InvalidateRect(m_rtOKBtn);
			flag3 = TRUE;
			flag4= FALSE;
		}
	}


	CWnd::OnMouseMove(nFlags, point);
}

int nTimer5 = 0;
void CPage4::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: Add your message handler code here and/or call default

	TASKPROGRESS ofx;
	memset(&ofx, 0, sizeof(TASKPROGRESS));

	if(nTimer5 == 0)
		ofx.pszText = TEXT("开始采集.");
	else if(nTimer5 == 1)
		ofx.pszText = TEXT("开始采集..");
	else if(nTimer5 == 2)
		ofx.pszText = TEXT("开始采集...");
	else if(nTimer5 == 3)
		ofx.pszText = TEXT("开始采集");
	ofx.nProgress = 1;
	m_pPage5->SetContentText(&ofx);

	nTimer5++;
	if(nTimer5 == 4)
		nTimer5 = 0;

	CWnd::OnTimer(nIDEvent);
}
